Work around a swig segfault issue when building on  Mac OS