[PATCH kernel-4.19] device core: Consolidate locking and unlocking of parent and device