Fix socket message delimiting

Change-Id: I5a510e505d1f2a0ab335c0bd5d3dd92c23331175