Add a copy of Monit's recv_ssl_socket() function.

Signed-off-by: Thiago Farina <tfarina@chromium.org>