Install dependencies only needed for tests earlier

At same time as other dependencies.  This (should) fix diamond
dependency problems where cabal installs QuickCheck with different
versions than used to build other dependencies, and then cannot actually
link the test suite.

Local testing indicates that --enable-{tests,benchmarks} does not pull
in packages for the test suites of dependencies.