Pip doesn't detect dependancies that failed to install

Use case:

I want to install paramiko, which depends on pycrypto. 

In order to exhibit the bug, I removed gcc so pycrypto will fail to compile on Linux. Originally I got the same problem on Windows which doesn't have a compiler installed by default

```Shell
py@vm-test:~$ virtualenv test.venv
New python executable in test.venv/bin/python
Installing setuptools, pip...done.
py@vm-test:~$ source test.venv/bin/activate
(test.venv)py@vm-test:~$ pip install paramiko
Downloading/unpacking paramiko
  Downloading paramiko-1.14.0-py2.py3-none-any.whl (148kB): 148kB downloaded
Downloading/unpacking pycrypto>=2.1,!=2.4 (from paramiko)
  Downloading pycrypto-2.6.1.tar.gz (446kB): 446kB downloaded
  Running setup.py (path:/home/py/test.venv/build/pycrypto/setup.py) egg_info for package pycrypto

Downloading/unpacking ecdsa (from paramiko)
  Downloading ecdsa-0.11.tar.gz (45kB): 45kB downloaded
  Running setup.py (path:/home/py/test.venv/build/ecdsa/setup.py) egg_info for package ecdsa

Installing collected packages: paramiko, pycrypto, ecdsa
  Running setup.py install for pycrypto
    checking for gcc... no
    checking for cc... no
    checking for cl.exe... no
    configure: error: in `/home/py/test.venv/build/pycrypto':
    configure: error: no acceptable C compiler found in $PATH
    See `config.log' for more details
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/py/test.venv/build/pycrypto/setup.py", line 456, in <module>
        core.setup(**kw)
      File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/home/py/test.venv/local/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
        self.run_command('build')
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
        self.run_command(cmd_name)
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/home/py/test.venv/build/pycrypto/setup.py", line 251, in run
        self.run_command(cmd_name)
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/home/py/test.venv/build/pycrypto/setup.py", line 278, in run
        raise RuntimeError("autoconf error")
    RuntimeError: autoconf error
    Complete output from command /home/py/test.venv/bin/python -c "import setuptools, tokenize;__file__='/home/py/test.venv/build/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MGF9Yt-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/py/test.venv/include/site/python2.7:
    running install

running build
running build_py
creating build
creating build/lib.linux-i686-2.7
creating build/lib.linux-i686-2.7/Crypto
copying lib/Crypto/pct_warnings.py -> build/lib.linux-i686-2.7/Crypto
copying lib/Crypto/__init__.py -> build/lib.linux-i686-2.7/Crypto
creating build/lib.linux-i686-2.7/Crypto/Hash
copying lib/Crypto/Hash/RIPEMD.py -> build/lib.linux-i686-2.7/Crypto/Hash
copying lib/Crypto/Hash/MD2.py -> build/lib.linux-i686-2.7/Crypto/Hash
copying lib/Crypto/Hash/MD4.py -> build/lib.linux-i686-2.7/Crypto/Hash
copying lib/Crypto/Hash/MD5.py -> build/lib.linux-i686-2.7/Crypto/Hash
[...]
copying lib/Crypto/Signature/PKCS1_PSS.py -> build/lib.linux-i686-2.7/Crypto/Signature
copying lib/Crypto/Signature/__init__.py -> build/lib.linux-i686-2.7/Crypto/Signature

running build_ext
running build_configure
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/py/test.venv/build/pycrypto':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/py/test.venv/build/pycrypto/setup.py", line 456, in <module>
    core.setup(**kw)
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/py/test.venv/local/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
    return orig.install.run(self)
  File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
    self.run_command('build')
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/py/test.venv/build/pycrypto/setup.py", line 251, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/py/test.venv/build/pycrypto/setup.py", line 278, in run
    raise RuntimeError("autoconf error")
RuntimeError: autoconf error
----------------------------------------
Cleaning up...
Command /home/py/test.venv/bin/python -c "import setuptools, tokenize;__file__='/home/py/test.venv/build/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MGF9Yt-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/py/test.venv/include/site/python2.7 failed with error code 1 in /home/py/test.venv/build/pycrypto
Storing debug log for failure in /home/py/.pip/pip.log
```

pip considers paramiko as correctly installed, even though pycrypto failed to install.

```Shell
(test.venv)py@vm-test:~$ pip list
argparse (1.2.1)
paramiko (1.14.0)
pip (1.5.6)
setuptools (5.4.1)
wsgiref (0.1.2)

(test.venv)py@vm-test:~$ pip install paramiko
Requirement already satisfied (use --upgrade to upgrade): paramiko in ./test.venv/lib/python2.7/site-packages
Cleaning up...
```

Of course, the newly installed package won't work well...

```Shell
(test.venv)py@vm-test:~$ python
Python 2.7.3 (default, Mar 14 2014, 11:57:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/py/test.venv/local/lib/python2.7/site-packages/paramiko/__init__.py", line 31, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/home/py/test.venv/local/lib/python2.7/site-packages/paramiko/transport.py", line 47, in <module>
    from paramiko.dsskey import DSSKey
  File "/home/py/test.venv/local/lib/python2.7/site-packages/paramiko/dsskey.py", line 26, in <module>
    from Crypto.PublicKey import DSA
ImportError: No module named Crypto.PublicKey
>>> import Crypto
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Crypto
```

I think pip should ensure that all dependancies installed successfully before considering that the requested package is correctly installed.

Here's a proposed fix.
 
With this, pip will always install dependancies first, and shouldn't install the requested package if the dep failed to install.