Make TaskOutputProcessor extend AutoCloseable and call close() when the job is done.