Unlock the mutex if the scan is interrupted