[SPARK-4859][Core][Streaming] Improve LiveListenerBus and StreamingListenerBus

Changes to LiveListenerBus and StreamingListenerBus:
* Fix the race condition of `queueFullErrorMessageLogged`.
* Make sure the SHUTDOWN message will be delivered to `listenerThread`.

Changes only to StreamingListenerBus:
* Log the error from listener rather than crashing `listenerThread`.
I see, got it. This is a different approach from the LiveListenerBus. This is okay for this PR, but i would really like these to be merged in the later PR, by using a common trait.