Bug 1033402 - waitForSocket() before connecting to marionette.

You can make your helper function take an optional ontimeout function? Abstractly, these things are doing the same thing...