Combine open_writeable_file() and dump_json_to_file()