Export constructors for Foreign.C.Types and System.Posix.Types newtypes

Part of trac #5529. We also now import the constructors in various
modules that use them in FFI decls.
Fix error in KQueue caused by changes to FFI import requirements
Warn about ArrowLoop instance for Kleisli Arrows

Suggested by Heinrich Apfelmus on the libraries list.
Update base for new Safe Haskell design
Update base for latest Safe Haskell.
GHC.Stats: Use camelCase in public APIs
add laws to class documentation
Add pure traceEvent and re-export from Debug.Trace

Previously traceEvent was exported only from GHC.Exts and had an IO
type. The new scheme is:

  GHC.Exts.traceEventIO    :: String -> IO ()

  Debug.Trace.traceEventIO :: String -> IO ()
  Debug.Trace.traceEvent   :: String -> a -> a

The new traceEvent has a pure type like Debug.Trace.trace and can be
used in pure code. The previous GHC.Exts.traceEvent is deprecated.
Update Debug.Trace haddock docs and rename putTraceMsg to traceIO

putTraceMsg is deprecated in favour of traceIO. This makes the names
more consistent.
Avoid using iconv for the locale TextEncoding if we can help it
Be more forgiving about encoding name capitalization/hyphenization
Fix build on Windows
use MVar to define fixIO, for thread-safety (see #5421)
addDependentFile #4900

Let GHC know about an external dependency that Template Haskell uses
so that GHC can recompile when the dependency changes.
No support for ghc -M
add unsafeFixIO (#5421)
export flushAllHandles (#5594)
Add unsafeShift to Data.Bits

This allows shifting by a non-statically known amount without
introducing a branch (to check for "overflow").
export tyConName, tyConModule and tyConPackage; deprecate tyConString
fix typo
Make dataToQa work regardless of the set of in-scope names (fixes #4491).

Use tyConPackage and tyConModule to determine the package and module to which a
data type belongs. With this information we can use mkNameG_d to build
constructor names which ensures that dataToQa creates TH terms that are
independent of the set of in-scope names.