Minimise network writes.

Using NetworkStream.WriteByte() results in multiple TCP packets being
sent per MQTT packet, which is very inefficient. This commit uses a
MemoryStream to amalgamate the whole MQTT packet, then writes it to the
NetworkStream.
Merge pull request #4 from oojah/master

Improve network writing.