Fix autojoin on newly imported users

Note that due to refactoring, the fix-autojoin admin action is now slower than before, but I'd say this doesn't matter, as this is only used extraordinarily.