core: Deduplicate code converting struct stat -> GFileInfo

We were doing the same thing in a number of places, make a helper
function.
Enforce 'rdev' (device file major/minor) is 0

Historically OSTree supported device files, but it wasn't useful, and
added attack surface.  Support was removed in

https://git.gnome.org/browse/ostree/commit/?id=62a896350bd54bff5a9413d2ee0fad7ff4364f9a

Perform a further cleanup by enforcing internally that the device
major/minor must be 0.

Conflicts:
	src/libostree/ostree-core.c