Fix JSON params parsing regression for non-object JSON content.

Backports #8855.
Merge pull request #8889 from dylanahsmith/3-1-parse-non-object-json-params

3-1-stable: Fix JSON params parsing regression for non-object JSON content.