SSL connection stability

Don't allow creation of AMConnectionRef with SSL context unless the socket is valid. Clear the SSL error queue before calling SSL functions and checking for errors.

I've got reproducible cases with large numbers of devices where an SSL context is created but the socket is invalid because the application hit e.g. a file descriptor limit. In that case, using any of the ServiceSend/Receive functions on the associated connection will cause issues because the SSL context doesn't have a socket. The change to AMDServiceConnectionCreate will make the service start routines return kAMDNoResourcesError instead of providing an inherently invalid AMConnectionRef.