Use sudo -H with pip

This is a minimal backport of fixes that went into master and devstack
to work around pip's use of ~/.cache and conflicts with DIB.

Related-bug: #1405626

Change-Id: Ie957726c606a0f63f35629c0616155b102983d7e