Fix stack size detection on OS X