Fixing auto-generation of usernames when email was already taken. Since (username) is empty on that point the following query never returned any rows and xxx-2 was always created, so it failed if xxx-2 was already existing.
bugfix #824: needed to add -user_id switch to some lang::user procs to specify the user for which to get the locale; also had to change the default upvar level of lang::message::lookup from 2 to 1