iOS buildfix, Mac/Linux shutdown fix

Mostly because of different flow, maybe was affecting Android too.  This should be more correct anyway.

@i30817 I only tested this on a Mac, how's Linux?

-[Unknown]