make sure the client leaves the room properly

Also don't send 'type' since on the server it is the name of the room and getPeers on the client side expects something like the string 'video'.

Cheers!