Fix registration of periodic tasks
According to
https://docs.celeryproject.org/en/stable/userguide/periodic-tasks.html?highlight=periodic#entries,
since we are adding periodic tasks in a callback in a task module,
we need to use the on_after_finalize
signal, rather than
on_after_configure
.
I also had to make some small changes to the app finalization that I worked out by trial and error.
Fixes #363 (closed).