instance.gen task: fix crash when using custom static directory Closes #1082 See merge request pleroma/pleroma!2237