The current tests (in state_machine) are focused on connection establishment (closed, listen, syn_sent and syn_received), it would be great to have more tests (for connection teardown).
It would as well be very nice to ensure via unit tests that whatever the other side does, at some point the connection will be discarded (and the memory be freed).