jsbuild: only build with ctypes if building with threads