Fixing unit tests on Travis.

Travis does not use distribute, it uses a recent version of pip (1.5.1
at time of writing) and a recent version of setuptools. Recent
setuptools imports urllib2 from setuptools.compat rather than importing
directly.

Updating our call to mock.patch to work on both older distribute and
recent setuptools, and specifying explicit distribute versions on
Travis.