jobs: fixed segmentation fault when thumbnail loader abort

JobManager grab a copy of the CWorkItem then release the lock,
if the cancel occurs right then. The callback can be in progress
after the CancelJob finishes.

Several locations assume it's safe to delete the callback target
after having cancelled pending jobs, so make sure we wait for
any in progress job completions or job progress calls.
Merge pull request #5764 from elupus/jobsegv

jobs: fixed segmentation fault when thumbnail loader abort