Revise implementation of overlapping type family instances.

This commit changes the syntax and story around overlapping type
family instances. Before, we had "unbranched" instances and
"branched" instances. Now, we have closed type families and
open ones.

The behavior of open families is completely unchanged. In particular,
coincident overlap of open type family instances still works, despite
emails to the contrary.

A closed type family is declared like this:
> type family F a where
>   F Int = Bool
>   F a   = Char
The equations are tried in order, from top to bottom, subject to
certain constraints, as described in the user manual. It is not
allowed to declare an instance of a closed family.
Have GHC depend on the stm package
Atomically increment the UniqSupply counter
Atomically update the name cache in tidyTopName

To pave the way for parallel --make, we need to make sure that all
modifications of shared mutable state are performed in a thread-safe
manner. This is one of such occurrences.
Make newTempName thread-safe

There is an obvious race condition between checking whether a file
exists and having the caller of newTempName bring the file into
existence so that it will have exclusive access to that file.

To remedy this, introduce nextTempSuffix to keep track of the next
unique suffix that a new temporary filename ought to have.
Make cleanTempFiles/cleanTempFilesExcept thread-safe

Atomically update the list of files to clean so that multiple threads
won't step over each other during cleanup.
Atomically update wrapperRef in mkWrapperName

It probably helps, and it definitely doesn't hurt.
Don't use unsafeDupablePerformIO in 'panic'

If multiple threads attempt to evaluate a panic at the same time,
more than one exception may be raised.
Make lazyGet thread safe

Evaluating multiple values returned by lazyGet from the same handle
can cause the inner (mutable) offset to be overwritten in between
lazy reads from the Handle, causing invalid results to be returned.
So replace the mutable offset with a fresh MutInt when deferring the
call to getAt.
make FastString thread-safe
Make newUnique and newUniqueSupply use atomic IORef operations
Implement inlinePerformIO correctly
Add the -j flag for parallel compilation
only update mods_done_ref if compilation succeeded
reverse the list of loaded modules like 'upsweep' does
don't assume that the home package is mainPackageId
Fix handling of ^C in the parallel upsweep

When spawning jobs we need to use forkIOWithUnmask to explicitly
override the masking state that the jobs are spawned in.
tighten handling of ^C in the parallel upsweep

- disable ^C when spawning and despawning the jobs
- allow async exceptions anywhere within the job's body

NB: i'm not sure whether it is safe to perform killThread under
    an uinterruptible mask
Use inlinePerformIO in mkFastStringBytes

The underlying operation is idempotent
Implement fastModifyMVar and use it in FastString

fastModifyMVar is like modifyMVar except that it is uninterruptible and
it assumes that the modifying action doesn't throw.