Dumb hack: check if fribidi is unsafe, and use a mutex if it is