Wraps cron in a transaction (fix #143)