Modified the code of sending the message of WebSocket.

JSR-356 spec specified follows.
Implementations of the WebSocket API may employ a variety of threading
strategies in order to provide a
scalable implementation. The specification aims to allow a range of
strategies. However, the implemen-
tation must fulfill certain threading requirements in order to provide
the developer a consistent threading
environment for their applications.
Unless backed by a Java EE component with a different lifecycle (See
Chapter 7), the container must use a
unique instance of the endpoint per peer. [WSC-5.1-1] In all cases, the
implementation must not invoke an
endpoint instance with more than one thread per peer at a time.
[WSC-5.1-2] The implementation may not
invoke the close method on an endpoint until after the open method has
completed. [WSC-5.1-3]
This guarantees that a websocket endpoint instance is never called by
more than one container thread at a
time per peer. [WSC-5.1-4]