Advance ap if socket(2) fails

In the case where socket(2) fails in SocketConnect, ap will advance,
causing an infinite loop.

https://dev.cfengine.com/issues/6560

Found by one of our engineers.