Make socket IPC more robust for windows version

Waiting for disconnection before reading (to ensure the whole message is
available) seems not to work at all on windows.  Instead, send the message
length first up so we known when we've recieved all of it.  This takes several
implementation hints from the QtLocalPeer class in QtCreator.

Fixes #17