Yeah I always thought the whole architecture of PAM being a library is weird. A sane person would have made it a Daemon that processes talk to surely?
Really it should probably be part of SystemD, but I know that would anger the anti-SystemD zealots.