Add support for subprotocols

The main change from the previous pull request is to make the function loading the subprotocols from the request operate on RequestHead instead of PendingConnection. This makes it easier to integrate this into yesod-websockets and also actually makes more sense because it now matches the similar function loading the version.

Note that the javascript tests only pass if you also merge in the commit with the new close message handling.