Encode the sliding sync rooms section in Rust as JSON bytes, without the GIL.