Add timeout to SockJSSocket 

This seems to work. All protocol (except ha) and client tests pass still. I cannot produce the NPE on the server anymore when JS is paused and ping timed out.