fix some issues with the worker loop: swallowing dispose exceptions and shutting down when a cancellation exception is used