thought about using MySQL as the LDAP backend.
If so, having the user table with auto-increment and unique uid would do
what you want.
So, you get the uid at return, and have no race condition problem.
Here is a setup how-to
I never tried it but it is an obvious solution for a database with "lots