Add support for logging over TCP

Add support for logging over TCP, which reduces the chances of events being unexpectedly dropped due to network congestion (which has been happening to me).

Tested (cursorily) on Python 2.6, 2.7, and 3.4.