Revert "Revert "Disable irrelevant migration tests for LMDB builds.""

This reverts commit d9e100940c14f4ff70be97f2a063aea5d03e118b.
As long as we don't fix the migration functions, these tests will
not run with LMDB.
Decouple cursor iteration from reading values.

Using ReadDB within a cursor iteration is not allowed (by LMDB),
causing deadlocks. The code now reads all hostkeys into a sequence,
and then looks up the needed values for the hostkeys.