check_ldap: add certificate support

Here's a patch adding the certificate expiration check feature to the ldap
plugin, based on the http plugin. For some unknown reason, probably due to
the way secure connection is established, it doesn't work with the --ssl
options, only for the --starttls one.
--
Just turning attached patch of github issue #1067 into a push request.
(Closes #1067)