ndg: Distinguish zero-length strings from NULL pointers when writing provenance