PDF: Fix potential crash
Probably doesn't happen often but pdfdoc usage also needs to be protected by the mutex