Remove shortcut for connections to localhost

... it was error-prone since connections are not only for file transfers
but also for query reporting etc. Check for localhost should be done on
a higher level (it is already done for file transfers in
ScheduleCopyOperation().
Simplified TLSSend, TLSRecv

This was done primarily to sanitize error messages, since retrying is
useless in a blocking connection and error stack was being messed
up. @cduclos if we need non-blocking functionality in the future we can
introduce it in separate functions.
-lssl requires -lcrypto and -lcrypto requires -ldl.