Fix #8832 - Parse '{"person":[]}' JSON/XML as {'person' => []}.

submitting @ndbroadbent 's patch for the 3.0 stable branch, as the bug introduced by the fix for CVE-2013-0155 applies to 3.0 as well

please see https://github.com/rails/rails/pull/8862 for details on the issue