Merge libcxxrt c812a07cd2f95c1403baf0bbe0366e7618d1d6d3:

* Don't call the _fast version of the TLS accessor in terminate() or
  unexpected().
  1) TLS may not have been set up yet.
  2) When we're in one of these functions, Really Bad Stuff has
     happened and potentially saving a few cycles really isn't
     important.
* Merge in fixes from FreeBSD trunk to make atomics work with recent
  clang.

MFC after:	1 week
Enable improved <tgmath.h> for Clang even when not using C11.

By using __has_extension(c_generic_selections), we can explicitly test
whether we're dealing with a version of Clang that supports _Generic().
That way we can use the improved <tgmath.h> code, even when not using
-std=c11. This massively reduces the compilation time when invoking
these functions.
Add missing static qualifiers

Reviewed by:	ed, jilles
MFC After:	3 days
Merge remote-tracking branch 'upstream/master'