Workaround for io:popen bug on MacOSX; simplified architecture detection