Merge "Change when sampling thread is reset during shutdown to prevent races." into lmp-dev