Changes for Safe Haskell

Makes minimal necessary changes so that modules will infer as Safe
for Safe Haskell.  Some modules are using rewrite rules, which are
not Safe; to these I added Trustworthy pragmas.  The rewrite rules
will continue to fire as normal, according to GHC's documentation.

Other modules import Foreign.  I changed these to import
Foreign.Safe instead.

I changed the time.cabal file so that the minimum version of Base is
4.4; that was the first version of Base that has the Foreign.Safe
module.  (base 4.4 came with GHC 7.2, which is over two years old.)
version 1.4.2; improve Makefile
Merge tag '1_4_2' of http://code.haskell.org/time/ into ghc-head