Disconnect if no waiting task at the worker can be executed

@dthain, @dpandiar