Modified the onClose method of WebSocket to terminate the thread.

I didn't implement the terminate method on Runnable Task.
So I added the terminate method on the concurrent Task and modified the
@onClose method of WebSocket Server endpoint.