Patches for check_ldap enhancement [sf#638898] [#146]