[PATCH v2 09/31] dm: core: Add a function to see if a device exists