Fix websocket path in cases where loc.pathname doesn't have a trailing slash