close ws connection on page unload