Run APScheduler in daemon mode and shut it down at exit

This is a possible fix for issue #253.