Update the package database directory's timestamps when rebuilding the package cache.

I was seeing many "WARNING: cache is out of date" errors during validation
claiming that my package cache was out of date. This patch eliminates those
errors by ensuring that when we rebuild the package cache, the modification time
of the directory containing the package database is set to be the same as the
modification time of the cache.
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.