Fix a race condition where the user changes nicks before the SQL query checking whether the old nick is registered returns

Does exactly what it says on the tin.