Replace QSem with MSem from the SafeSemaphore package.

Control.Concurrent.QSem is deprecated and will be removed in GHC 7.8. The
documentation recommends using the SafeSemaphore package instead. Since this
package is not in the platform, we add the relevant module to
Distribution.Compat. Tested by running `cabal install -j2 ghc-core` on a fresh
~/.cabal.

SafeSemaphore uses the same 3-clause BSD license as Cabal.
Use MSem's 'with' combinator.
Make the comment more clear.
Remove the getSandboxInfo function.

It did reduce duplication, but made the code harder to read.
Filter autogen files (such as Path_foo) from exposed-modules when running sdist. Previously autogen files were only filtered from other-modules.
Make sandbox-init rewrite the pkg env file if it exists.
Make shared sandboxes work.

Instead of always using './.cabal-sandbox', load the sandbox path from
'cabal.sandbox.config'.
JobControl: Use STM-based QSem and add stm dependency

This is in place of the deprecated implementation from
Control.Concurrent. New implementation due to Simon Marlow. Note that
this has only been tested against stm-2.4 despite the permissive version
bounds given in the cabal file and bootstrap script.
Revert "Replace QSem with MSem from the SafeSemaphore package."

This reverts commit ea1f338e9e9858e3480f439e22012f0d1c0815fc.

Conflicts:
	cabal-install/Distribution/Client/JobControl.hs
Merge branch 'master' of https://github.com/bgamari/cabal
Clean-ups to D.C.Semaphore
Merge branch 'master' of https://github.com/stepcut/cabal
Use #ifdef on process instead of on GHC
The MIN_VERSION_process macro is not defined when bootstrapping
Fix a bug in D.C.Semaphore

Code by Simon Marlow.
Fix a bug that caused important debugging info to be deleted in modular solver.

The question is whether or not cabal-install will tell you why it tries
a particular goal (i.e., because it's the dependency of something else).

This regression was introduced between 0.14.0 and 1.16.0 of
cabal-install in order to fix a space leak. Restoring the information
actually costs some space again (although not as much as was required
back in 0.14.0).  I think the extra info is worth it though.
Undo some hlint-related changes in the modular solver.

I think the extra parentheses in the type signatures help to
understand the intended use of functions.
Make '--dependencies-only' a synonym for '--only-dependencies'.
Rename GoalReasons to GoalReasonChain.

Just a refactoring.
Update dependencies