Add a `pip check` command.

This command ensures that all packages installed have all the
requirements they need, and that requirements have compatible
versions. This is useful because pip can install incompatible
dependencies[1], or a user may have manually (un)installed a
package.

[1] https://github.com/pypa/pip/issues/775

This is loosely inspired by Haskell's `ghc-pkg check`, which has a similar purpose.