Fix reading and writing to the wire.

Check the amount actually written / read to the wire. Make sure that we get all the data we asked for, and wrote all we could.

In the case of recvPackets this caused us to not fully read a payload, and cause our interpretation to get corrupted. In my case, causing gigabytes of memory to be allocated by go, and resulting in a crash.

Also update debugPrint so that when there are multiple wireProtocol's running we can identify which log statements are related to each other.