Issue title: Shell Integration wrong exit code if run same command for multiple times
 Issue body: <!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.68.1
- OS Version: Ubuntu 20.04

Steps to Reproduce:

1. enable shell integration in bash
2. run ```python -c $'import random\nif (random.randint(0, 1000) % 2 == 0):\n  raise NotImplementedError \n'``` for multiple times
![image](https://user-images.githubusercontent.com/73811981/177729325-f2963405-2391-4b7a-9e72-47589be79945.png)

I believe this is caused by [this line](https://github.com/microsoft/vscode/blob/1.68.1/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh#L70). bash history index won't be increased if we run same command.
 Comments: 
 Comment 0: Very observant 😅 

This is tracked in https://github.com/microsoft/vscode/issues/143766, I'll see if we can get this covered for v1.70

/duplicate
{'source': 'GithubIssues', 'repo_name_with_owner': 'microsoft/vscode', 'issue_id': 1297037347, 'repo_stars': 72158.0}