Merge "libdm: Add a helper function for GetState+DeleteDevice checks."