Print to provided output stream in deprecated 'write-json'

Originally reported by Benjamin Teuber in a GitHub pull request:
https://github.com/clojure/data.json/pull/9