Bug 1071249 - Create cron job for expired tasks

Add routine to close attempts for expired tasks
Create another task that shouldn't get closed to verify that the code doesn't close all tasks.