Cancel job in destructor, if necessary.

API clients might delete a running job without calling canel(), so
we must do that ourselves to prevent a deadlock.

Change-Id: I379d0a7c2a1d108cc372188262677d6be1effff2
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>