Improved locking of CompressAndCheck, hopefully solves deadlocks