Fix misuse of same-origin policy

Due to a misapplication of the websocket RFC, we were sending the
system name as the origin, instead of the hostname.  It turns out that
it should be fine not to even send the origin at all, since there's not
a possibility of cross-origin issues with emacs.
Fix breaking test.

The websocket-close test was failing. The test has been updated to fix
the breakage, which was caused by assuming the wrong function would be
called by the underyling code.
Merge branch 'close-testing-fix'
Merge branch 'same-origin-fix'