controller: clean up job data if a thread gets cancelled waiting in a function