Fix StatementList not reindexing associative arrays

This issue was introduced in #285 but had no test, unfortunately. It made tests fail in https://github.com/wmde/WikibaseDataModelSerialization/.