Fix relying on order of unordered types

Modified version of #234

All changed tests have in common that they assert a specific ordering of
an unordered data structure (dict or set). The assertions have been made
more liberal with respect to the order of entries.

Command used for finding failures of this kind:
for i in `seq 100`; do echo PYTHONHASHSEED=$i;
PYTHONHASHSEED=$i $PYTHON run-tests.py || break; done