Fix public_trial DictStorage upgrade step

Two fixes for upgrade step `3400` in `opengever.tabbedview`:

- Deal with broken records that have a `NULL` in the DB
- Iterate over `query` instead of `query.all()` to keep things lazy and avoid fetching all records at once