Address some bugs in applyPDroid.sh

old log was never wiped, so old failures erroneously reappear. Also,
greping the failures to print to screen was failing due to outdated variable
handling.