Fix GetPathToDeviceInfo, GetPathToPartitionInfo for loop devices

This rewrites the code entirely to make:
 - sd* devices are the exception, not the rule with losing their number
 - Take advantage of NRVO
 - Make GetPathToPartitionInfo() call GetPathToDeviceInfo()

Also adds a unit test.

@jmlvanre: Look good to you?