Fix onclose timeout

This is a fix for https://olarktrack.atlassian.net/browse/CHAT-1206.

I don't think this is an ultimate solution, for that we need to plan on removing socket.io. This will give us time to not rush that though.