Preserve return code from QApplication exec