haskellPackages.mkDerivation: avoid forcing stdenv.cc if missing
If we don't check `hasCC`, we run into trouble on pkgsCross.ghcjs, one
of the few platforms where `cc` will throw
(so `stdenv.cc.isClang or false would` not be enough).
Problem introduced in 8164b190 / #266172.