avoid nullptr to enable compilation with g++ 4.4.7

For some reason

   if (thread_exception)
      std::rethrow_exception(thread_exception);

does not work (but it should)!
factor out thread exception pointer handling

This avoids a dependency of the meta code on the two-scale model
class internals.