Seamless worker termination

Previously when the worker was told to terminate by the server it would shutdown all messages between the worker and server. Instead now it stops taking messages from the server, but still acts like it can send messages. This allows the worker to 'finish' its current task before finding out it needs to shutdown.