serde: Write JSON to file