[driver-core PATCH v9 2/9] device core: Consolidate locking and unlocking of parent and device