Uniformize setup and teardown code.
Uniformize setup and teardown code.

aaugustin/websockets,aaugustin/websockets,aaugustin/websockets,dommert/pywebsockets,andrewyoung1991/websockets,biddyweb/websockets,aaugustin/websockets