fixed a couple of compiler warnings
EmulatorDriver: guard against calling waitForBytesWritten on unconnected TcpSockets
minor tweaks to example-2