device_get_path(): handle case when dev is root
PR: 266862
Based on submission by: takawata
Reviewed by: jhb, takawata
Disscussed with: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36899