Patches for check_ldap bug fix [sf#836010] [#255]