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
Merge pull request #1952 from worr/bug/socketconnect-loop

Advance ap if socket(2) fails
Correct the early/late distinction logic in stime_range.cf

I'd correctly documented, in the comments, the comparisons needed; but
I'd got the tests the wrong way round in the policy language code.
Clarified a comment earlier, while I was fixing that.
Merge pull request #1957 from ediosyncratic/stime-test-fix

Correct the early/late distinction logic in stime_range.cf