add fix to LDAP enrolment script

see https://tracker.moodle.org/browse/MDL-43430