Make unique_name a little more robust in the face of directory
ordering.

Also add a unique_device method.
Merge pull request #125 from VictorLowther/pull-req-release-mesa-1.6-master-98263bd30c9272dc9a56660fb15a5b74f0cb5685

DE1178: Make finding the proper boot device mode robust. [1/2]