configure.ac: Test for broken "extern template"

Certain versions of gcc (at least, 4.9, and some trunk versions
following that) have problems when "extern template" and -flto are
used together together with some files _not_ using -flto.

Test for that condition and disable "extern template" if we detect it.
configure.ac: Enable use of "extern template" by default

Now that we have a configure check for the problem we were working
around, we can re-enable "extern template" by default.