fixed ctypes library loading to set errno on failure