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
Add xasprintf() to the suggested alternatives, it can replace the malloc()+sprintf() idiom.
Connection cache sanitisation

No change in functionality hopefully.
Make connection cache aware of port and flags.
Move forgotten files to proper directory.
Enable a bunch of cf-serverd acceptance tests to test multiple protocol versions and connect to multiple servers.