Changed 'lockedBy' function internal code

It will continue to work the same for any code that is already
using it. It now returns a third value in its tuple: an exception
object (if any exceptions occured) or 'None'. Also, the way that
real names are discovered no longer directly depends on LDAP,
making the code slightly more portable.