Adding missing instantation of C wrappers for ThreeValued matrices and fixing mistakes in recent syntax changes for ctypes.pythonapi.PyFile_AsFile