Bug 1033402 - Part 1: waitForSocket() before connecting to marionette.
Bug 1033402 - Part 2: unit test for the waitForSocket.