Test that if the socket is closed immediately on creation, then the socket emits a close event.