Attempt to clean up PAM code

Use PWDB getpw* functions if HAVE_PWDB defined

Minor other tidyups
4 files changed