Make get_next_device_name() handle an instance object

This utility method is passed an object, but does things that assume it
is a dict. This fixes that, and updates the tests to match.

Related to blueprint flavor-from-sysmeta-to-blob

Change-Id: I7041b8ffae100463eafe45926f0d16d00165ba73
Merge "Make get_next_device_name() handle an instance object"