core: Use QCoreApplication::exit() instead of just exit()