run-tests: set attributes in sorted order

Authored by indygreg.

Description

run-tests: set attributes in sorted order

Python 3.8 preserves insertion order in serialized output
(https://bugs.python.org/issue34160). Older Pythons serialized
in sorted order.

Let's make insertion order sorted so behavior is consistent across
Python versions.

Differential Revision: https://phab.mercurial-scm.org/D5831

Details