Backported core_user_add_user_device