MDL-42884 core_user: fixed issue when deleting users with invalid emails throws invalidusername exception