Clean up orphaned tasks logs

Addresses #229

Without this, tasklogs will accumulate over time and eventually fill up
the master's disk.
`file` -> `filepath` please since `file` is a built-in in Python 2.