pkgs/development/compilers/ghc/with-packages.nix: improve recognition of Haskell packages

Haskell packages -- i.e. packages built by our Cabal builder -- invariably have
the attributes 'pname' and 'version'. We use the absence of these attributes to
recognize non-Haskell packages and filter them from the closed package set
generated by closePropagation. We do this so that the generated Haskell
environment won't contain paths like "/lib/libz.a", which are part of the
closure but have nothing to do with Haskell.

The previous scheme used the attribute 'ghc' to accomplish the same thing, but
unfortunately other packages to contain a 'ghc' attribute, too, like the
old-style ghc-wrapper. Including the ghc-wrapper in this environment is
pointless, obviously. The new approach filters the ghc-wrapper successfully.
pkgs/development/compilers/ghc/with-packages.nix: add 'ignoreCollisions' parameter

The ghcWithPackage expression now has an argument 'ignoreCollisions' that
allows users to disable the path collision check like so:

  (pkgs.haskellPackages.ghcWithPackages (pkgs: with pkgs; [ haskellPlatform ])).override { ignoreCollisions = true; };

See https://github.com/NixOS/nixpkgs/commit/d64917ad17277b8e16893ee31533ec2e33446fa7
for a long and detailed discussion of why these path collisions may occur.