Add a unit test for thread local compression
thread.cpp: Fix history-enabled build