PDF plugin: fix another race condition