Replace list.sort() with sorted()

In OpenStack heatclient project, there is error running in py33 env:
https://bugs.launchpad.net/python-heatclient/+bug/1243096

For the Python 2&3 compatability, use sorted() builtin to replace
list.sort().

This change is verified in OpenStack heatclient/novaclient projects.
(tox -e py27 / tox -e py33)