Fix MIME type creation error

DatabaseLocation::OpenOrCreateType(): BNode::WriteAttr() returns the
number of bytes written, not just an error code., so we erroneously
reported an error on success.

Fixes the first part of #9845.