Fix #to_json for IO objects, fixes #26132
#30953

rohitpaulk wants to merge rohitpaulk:fix-io-to-json into rails:master

We do not currently have an analysis of these two commits