Adapt OSX sim to the new flash API changes

Also fixes compile issues when compiling sim-osx on linux.