NSApp.terminate() is not a requirement to properly shut down a cocoa
App since it only calls exit() internally. though when not used the
cocoa termination events won't trigger, which we don't need. this
prevented us to exit with a proper exit code.
rework the whole termination logic to end up at one point where we can
return the exit code from the mpv_main function.
Fixes#7456