[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`.
Is there a cost to using volatile variables here? There are different discussion around the web about the cost of the volatile being different for different architectures, and since this can be a high volume bus, its probably not a good idea to use a volatile variable. In fact it actually mixes two different concurrency models (single-threaded actor, and threadsafe volatile) which is usually not a good idea.