Use close codes to indicate why websocket was closed
<!--IssueSummary start-->
<details>
<summary>
Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards.
</summary>
- [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=325105)
</details>
<!--IssueSummary end-->
There are cases when we terminate the websocket connection to the client on our own:
- changed authentication settings
- cannot read / write from the upstream terminal provider
- session timeout (to be added)
We should use close codes to communicate the reason why the connection was closed to our frontend. See https://gitlab.com/gitlab-org/gitlab-ce/issues/26277#note_21331208.
### References
https://tools.ietf.org/html/rfc6455#section-7.4.1
issue