safe_close() returns void

as all its callers ignore the return value anyway.
Fix fd leak on error paths in do_connect()
Don't format the request header twice in sproxyd.
Remove unused variable in dpl_uks_gen_key_raw()
Remove unused variables in profile_utest.c
Emit log messages when connecting to servers fails

always, not just when tracing is enabled.
Unit test errors from a failed connect.

Test that errors are logged and do include the hostname, port
and error message.
Add missing linker flag for dlsym