libblkid: Make sure we never reference a null dev->bid_type

There were a few places where we don't check to make sure
dev->bid_type is non-NULL before dereferencing the pointer, mostly in
debug code.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/lib/blkid/save.c b/lib/blkid/save.c
index 76f2f9e..60aa6ce 100644
--- a/lib/blkid/save.c
+++ b/lib/blkid/save.c
@@ -34,7 +34,8 @@
 		return 0;
 
 	DBG(DEBUG_SAVE,
-	    printf("device %s, type %s\n", dev->bid_name, dev->bid_type));
+	    printf("device %s, type %s\n", dev->bid_name, dev->bid_type ?
+		   dev->bid_type : "(null)"));
 
 	fprintf(file,
 		"<device DEVNO=\"0x%04lx\" TIME=\"%ld\"",