Fix quoting of query for user_ldap ref #1983

in #1983 user_ldap app have some quoting problem that lead to a showstopper bug especially with postgres...

i've tried to fix that ...

*Please test it! i haven't tested it !!! .... i don't have a ldap install!*

(please test at least that the app sill work with mysql & ... )