[2.11.x] Escaping values while constructing LDAP filter

https://issues.sonatype.org/browse/NEXUS-6881
https://issues.sonatype.org/browse/NEXUS-5840

Depends on sonatype/sisu-ldap-testsuite/pull/1 for UTs to work

http://bamboo.s/browse/NX-OSSF310
This doesn't look right as the previous statement just replaced `${username}` with `{2}`... presumably this check should be done before the replace?