This is HostileFork's "notorious TCP bug (EVM_DEVICE events allowing ports to GC)" fix minimized. It is meant as an alternative to his pull request.
Merge pull request #161 from ladislav/event-gc-bugfix

This is an alternative to HostileFork's "notorious TCP bug fix"