write-commands: generate proper array indexes for local bson documents.

We were generating empty keys here, which is fine, but not really
expected by the lower components. Let's go ahead and just generate
the key values.