Make sure exceptions on close are observed for websockets.

#1846