inline _check_rc for cython backend

pure Python calls were expensive
also fix a few libc cimports