Remotery: Fix further race condition on shutdown with self-profiling of the remotery thread.