Can I force a running Background to quit when the MainApp starts up?

My Widget has an initial data-loading "phase" that takes multiple http requests to finish.

It is triggered from the Main App, but when the user quits it or lets it time out, the background picks up where the loading was left off.
The actual loading code is the same for main app and background. The current progress is alwas saved to storage, so that's how data is exchanged between BG and MainApp.

I have the issue that if the background is busy loading stuff, and the MainApp starts at that moment, they suddenly start loading things concurrently which of course messes up my logic.

My Question:

Can I force the background to exit when the MainApp starts?

I tried a static variable "_mainAppRunning" in AppBase, that the Background could check, but apparently static variables exist separately per Background/Foreground. I assume they are actually separate processes...