Replace PyPAM with ctypes implementation.