Allow pubsub listener to be shut down while in a callback.

Allow pubsub listener thread shutdown from within a callback by trapping the RuntimeError on join not being able to join itself.