Allow ActivityWorker to shutdown cleanly

ActivityWorker doesn't shutdown cleanly.

It registers a @shutdown_first_time_function in initialize that does a Kernel.exit on sigint/term.  But the exit exception is caught by the poller (task_poller.rb line 182), so the ActivityWorker continues the task polling loop.

This change just ends the loop if the worker is shutting down.

-------
Also tacked on a logging cleanup commit.  Let me know if you want that in a separate pull request.