Fix cron.add_task [#209, #231]

Cron task files would be created with the wrong owner [#209],
and unwanted backup files could be created if a task with the
same name already existed [#231].
Expose optional environment parameter in cron.add_daily()