Parse '{"person":[]}' JSON/XML as {'person' => []}

We're also affected by #8832, so this is an attempt at solving that issue. Here's how JSON/XML will now be 'munged':

<table>
<tr><th>JSON</th><th>Hash</th></tr>
<tr><td>{"person":[]} </td><td> {'person' => []}</td></tr>
<tr><td> {"person":[null]} </td><td>{'person' => nil}</td></tr>
<tr><td> {"person":[null, null, ...]} </td><td> {'person' => nil}</td></tr>
<tr><td> {"person":["foo", null]} </td><td> {'person' => ["foo"]}</td></tr>
</table>

I know there must be a reason for replacing `[]` with `nil`, but I can't figure out how this would be a security risk. Could someone please help me understand the 'args injection' problem?

FWIW, the AR tests are still passing at https://github.com/rails/rails/commit/d5cd97baa44fa66dc681041a213092b45c57c32#L7R27.