make order consistent across Ruby vsns w/sort

Fixes #2635.  In particular, link and cookie order differ
between Ruby 1.8.7 and 2.x, causing the test suite to fail
under 1.8.7.
Merge pull request #2734 from rolandwalker/sort_predictability

make order consistent across Ruby vsns w/sort