Fix: notifications are never removed

Sometimes notifications are never removed.

I think the problematic call stack is this:
- stopForeground and remove notifications
- stopScanning
- flush bundle
- update metrics and notification (scanner appears to be active still)
- scan manager only then sets scanning state to stopped