Fix utils.total_ordering on 2.x

This should fix sporadic failures in test_types.