fix pip breaking due to setuptools/pip/cryptography problem
fix pip breaking due to setuptools/pip/cryptography problem

pip<6.1 + setuptools>=34 have a problem with packages that
try to update setuptools during installation, like cryptography.
See https://github.com/pypa/pip/issues/4253. The Ubuntu 14.04
package versions are pip 1.5.4 and setuptools 3.3. When we
install cryptography under those versions, it tries to update
setuptools to version 34, which became available about 10 days
ago, and then pip gets permanently broken with errors like
"ImportError: No module named 'packaging'".

The easiest work-around on systems that aren't already broken is
to upgrade pip and setuptools individually before we install any
package that tries to update setuptools.

Also try to detect a broken system and forcibly remove setuptools
first before trying to install/upgrade pip.

fixes #1080, fixes #1081, fixes #1086
see #1083
see https://discourse.mailinabox.email/t/error-with-pip-and-python/1880
see https://discourse.mailinabox.email/t/error-installing-mib/1875

m4rcs/mailinabox,m4rcs/mailinabox,ianberinger/mailinabox,ianberinger/mailinabox,m4rcs/mailinabox,m4rcs/mailinabox,d5ve/mailinabox,ianberinger/mailinabox,mail-in-a-box/mailinabox,d5ve/mailinabox,ianberinger/mailinabox,mail-in-a-box/mailinabox,ianberinger/mailinabox,m4rcs/mailinabox,mail-in-a-box/mailinabox,d5ve/mailinabox,d5ve/mailinabox,mail-in-a-box/mailinabox,d5ve/mailinabox