I never observed any locking.  But what seems to happen is that the delete loop just starts running and causes competition for server resources, increasing CPU utilization to 100% for however long the deletes take to run. 

The set_time_limit(0) is a little risky because it means the loop could run forever, although I would hope that deleting 200 records wouldn't take forever.

I also believe that if a site was getting more than 200 temporary user profiles per hour created, this loop would never catch up and purge the users.

The memory usage growing and causing an exception is a problem that we should try to avoid, but picking 200 deletes because it works in one configuration isn't a good solution for all configurations.

Deleting only as many users as could be deleted in 10 seconds seemed a better proxy for not going over memory limits and not monopolizing the CPU than hard coding 200 deletes.

If we want we can check to see if we are approaching the PHP memory limit.  THen stop processing if we are.  I am slightly against this idea because we don't do it anywhere else.  If we do it here, to be consistent there are other areas that should get the same treatment.  The combination of the 10 second delete time and the running the deletes in a clean 'AJAX' invocation seem to work well.