Some fixes and hooks for dbgcheck calls.

The main fix in this commit is that we can now correctly handle partial
tcp headers (I mean application-level headers, not part of tcp itself).
Previously, if a recv call gave us a partial header, we would freak out
and go into undefined behavior mode. Now we wait for the remainder of
the header to arrive (asynchronously).

The only bad part about the current set up is that I suspect we may
effectively be busy-waiting when we're in a partial header state.
However, it is a rare case that we're even more unlikely to be stuck in
for long, and even then the busy-waiting (I *think*) is not crazy
terrible.