In read_map_objects() and write_map_objects(), return error code right on error, not only after collecting further possible errors.