Apply optparse change to pdbquery

I kept the exit code this time (and put it back for puppetresources).