Repository: thundernest/k-9
Issue: SearchPreferenceActionView crash on orientation change

### Steps to reproduce
1. Open 'General settings'
2. Click on search icon
3. Optional: enter some text
4. Change screen orientation

### Stacktrace

Tested with a93be23c831d39ce19fe3e30b2f4674314695abb

```
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
        at androidx.fragment.app.FragmentManager.checkStateLoss(FragmentManager.java:1691)
        at androidx.fragment.app.FragmentManager.enqueueAction(FragmentManager.java:1731)
        at androidx.fragment.app.BackStackRecord.commitInternal(BackStackRecord.java:321)
        at androidx.fragment.app.BackStackRecord.commit(BackStackRecord.java:286)
        at com.bytehamster.lib.preferencesearch.SearchPreferenceActionView.removeFragment(SearchPreferenceActionView.java:100)
        at com.bytehamster.lib.preferencesearch.SearchPreferenceActionView.cancelSearch(SearchPreferenceActionView.java:79)
        at com.fsck.k9.ui.settings.general.GeneralSettingsActivity.onSaveInstanceState(GeneralSettingsActivity.kt:53)
        at android.app.Activity.performSaveInstanceState(Activity.java:2044)
        at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1485)
        at android.app.ActivityThread.callActivityOnSaveInstanceState(ActivityThread.java:5304)
        at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4630)
        at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5252)
        at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5187)
        at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
```

Changed files:
app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsActivity.kt

diff --git a/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsActivity.kt b/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsActivity.kt
index 78e50fd92..1f0b90fdb 100644
--- a/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsActivity.kt
+++ b/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsActivity.kt
@@ -50,7 +50,6 @@ class GeneralSettingsActivity : K9Activity(), OnPreferenceStartScreenCallback, S
         if (::searchPreferenceActionView.isInitialized) {
             outState.putString(KEY_SEARCH_QUERY, searchPreferenceActionView.query.toString())
             outState.putBoolean(KEY_SEARCH_ENABLED, !searchPreferenceActionView.isIconified)
-            searchPreferenceActionView.cancelSearch()
         }
         super.onSaveInstanceState(outState)
     }