UEditorLoadingAndSavingUtils::SaveDirtyPackages

Looks at all currently loaded packages and saves them if their "bDirty" flag is set.