Issue title: termux-url-opener just flashes when termux is currently open
 Issue body: <!--
IMPORTANT:

1. Support of Android 5.x - 6.x is finished.
2. Fill the template AFTER comments.
-->

**Problem description**
<!--
A clear and concise description of what the problem is.
You may post screenshots in addition to description.
-->
When termux is open and I trigger the url opener intent via adb, it quickly flashes and disappears

**Steps to reproduce**
<!--
Steps to reproduce the behavior. Please post all necessary
commands that are needed to reproduce the issue.
-->
1. Open termux
3. `mkdir bin`
2. `echo -e '#!/usr/bin/bash\necho "$@"\nread' > bin/termux-url-opener`
4. connect to your phone with `adb shell` (leave termux open on mobile)
5. in the `adb` shell, run command `am start-activity -a android.intent.action.SEND -t text/plain -e android.intent.extra.TEXT "https://example.com/" com.termux/com.termux.filepicker.TermuxFileReceiverActivity`. nothing happens
6. now go to home screen on mobile (don't kill termux, just "minimalize" it)
7. repeat step 5, just with different domain to see difference. now the opener script shows up with this domain
8. press enter on mobile. the second script ends, and the first one opens again

**Expected behavior**
<!--
A clear and concise description of what you expected to happen.
-->
The opener script should open directly after the intent is run, even when termux is open

**Additional information**

* Termux application version: 0.101
* Android OS version: 9 / MIUI Global 11.0.4
* Device model: Xiaomi Redmi 6

 Comments: 
 Comment 0: Do you see any warnings/errors if you check a logcat when running the command from adb shell? 

Try changing from #!/usr/bin/bash to the proper path (#!/data/data/com.termux/files/usr/bin/bash) in case [termux-exec](https://github.com/termux/termux-exec/) is not LD_PRELOADED in this case
 Comment 1: Changing shebang makes no difference.

Logcat shows a lot of stuff, but I ain't reading it all, anything specific I should look for? Can you reproduce the issue to see what exactly is happening?
 Comment 2: Have you checked that it doesn't open a new session where the script runs?

When I share a url to termux from termux it stays on the same session after the flash, but a new session is opened with termux-url-opener running. 
 Comment 3: Yes, it opens a new "session", but it doesn't show up in the left drawer, and only shows up after i run the adb command again and resolve that (order start 1, start 2, 2 shows and finishes, 1 shows and finishes).

I also observe similar behavior when some other app is running (not being interacted with) in the foreground - sometimes it works on the first try, and sometimes the first run "flashes", and when i trigger the script once again, it again shows 2, and after it finishes, it shows 1.
 Comment 4: Seems like i have similar issue
```
url=$1                                                  echo "Что прикажешь делать с $url ?"                    echo "y - Загрузить видео"                              echo "p - Загрузить плейлист"                           echo "x - Выход"                                        
read CHOICE
case CHOICE in
        "y")
                cd /data/data/com.termux/files/home/storage/shared/termux-storage/yt                                            yt-dlp -f 'bv+ba' --embed-thumbnail --embed-chapters --no-check-certificate --sponsorblock-mark all --download-archive videos.txt $url
                ;;
        "p")
                cd /data/data/com.termux/files/home/storage/shared/termux-storage/yt                                            yt-dlp -f 'bv+ba' --embed-thumbnail --embed-chapters --no-check-certificate --sponsorblock-mark all --download-archive videos.txt $url -o '%(channel)s - %(playlist_title)s/%(title)s.%(ext)s'                                  ;;
        "x")                                                            echo "До связи"
```
Have this script, when i share yt video it shows
```
Что прикажешь делать с https://youtu.be/dQw4w9WgXcQ ?
y - Загрузить видео
p - Загрузить плейлист
x - Выход
```
And when i type y and press enter, it closes session
 Comment 5: > case CHOICE in

Scripting error there. You need to retrieve the value from variable, therefore need to use `case "$CHOICE" in`.
 Comment 6: Thanks, completely missed it
{'source': 'GithubIssues', 'repo_name_with_owner': 'termux/termux-app', 'issue_id': 719378362, 'repo_stars': 17541.0}