Added option to deactivate the task queue.
Deactivate the handler before deleting the adapter.

This makes sure that there are not outstanding threads active which the
adapter might be waiting for.