Set passwords when switching to unmanaged

If we're changing a user to "unmanaged" but have a blank password, set
something random for the password so they can use the password reset
functionality. Since https://code.djangoproject.com/ticket/20079, users with
blank passwords cannot use "reset my password" (email doesn't send) if
user.has_usable_password is False.