VS Code freeze on build/cancel sequence

Cancelling a build using the trash can icon cause VS Code to freeze and a restart is required.

To reproduce :

  1. Start a build from the “Project Tasks”
    piobuild
  2. Cancel the build in the terminal window using the trash can icon
    pio

Bug report to GitHub - platformio/platformio-vscode-ide: PlatformIO IDE for VSCode: The next generation integrated development environment for IoT please.