[PATCH] Driver core: fix locking issues with the devices that are attached to classes