Backport PR #4909: sort dictionary keys before comparison, ordering is not guaranteed

failed for me on 1.x with

    nose.proxy.AssertionError: AssertionError: Lists differ: ['a', 'b'] != ['b', 'a']

(2to3 wraps a list around it)
Backport PR #4720: never use ssh multiplexer in tunnels

`ssh -f` is [broken in OpenSSH](https://bugzilla.mindrot.org/show_bug.cgi?id=1948) when a ControlMaster multiplexed connection is used.

`-S none` disables the multiplexed connection.

closes #4717
Backport PR #4748: fix race condition in profiledir creation.
Backport PR #4820: fix regex for cleaning old logs with ipcluster

It still had the 'z' suffix from ages and ages ago, so no files would ever match.

closes #4810
Backport PR #4840: Error in Session.send_raw()

Addresses issue ipython/ipython/#4839.

(This is my first pull request, and first contribution to ipython, so should be checked to make sure that my assumption about the problem is correct).