macosx: Attempt to avoid a crash. Note that this can't be working properly and could create a rare race.