Replace NSNull with empty dictionary before writing to subpath.

Treat NSNull.null the same as nil.