Remove invalid characters from original metadata keys and values

See https://trac.openmicroscopy.org.uk/ome/ticket/10304.  This should solve the issue of invalid metadata characters going forward, but won't help the situation for data that has already been imported.