util/upload: catch failures to map_range and return error