Provide a low-level wrapper for Tornado Websockets that adds locking
and smooths some compatibility issues.
Used for compatibility across Tornado versions and to add write_lock
Close the websocket.
Read a message from websocket and execute a callback.
Write a message to the websocket after obtaining the appropriate
Bokeh Document lock.