Update websockets.php

Simplified $this->users and $this->sockets use by indexing them on the $user->id.  This not only makes the code a bit clearer, but also improves the processing.

I didn't want to impose with another change I would do, but I strongly suggest that you refer to 'userSession' or 'session' instead of 'user' globally as it will get confusing if a user management layer is added.