PDF: really fix the race condition during scanning