BUG: fix a few fortran ABI bugs on Mac OS X + MKL.

I took that opportunity to consolidate a bit our code to deal with it in
various places.