Fix permission checking in pmdapapi

Test qa/914 was failing because the permission checks its
verifying were not seeing PM_ERR_PERMISSION as expected.
This is because of some overlooked flags in pmdapapi that
were intended to verify that a uid/gid had been observed.
We also need to capture end-client event and ensure this
state is properly reset for future clients.

Remove a well-intentioned but not quite correct comment in
the PMDA whilst in the neighbourhood.