libpam: Play some 4D chess for static pam modules support.
We need A, B, C and D. C depends on A, B depends on D, A&B and C&D are both
built in pairs. So split A&B and hope for the best.
PAM modules were moved in closer to support this in the previous commit.
Also use workaround to get matching set pointers. Might be a pam bug.
Now su(1), login(1) and friends are usable in -static compilations with
pending buildworld support patches.
No functional change to usual case of shared libpam.so.
Partially-taken-from: FreeBSD