Move fin_task to a common rspamd_fin_task function.