Fix LSM shutdown wait condition.