Clipboard could be incorrectly emptied when the browser is run inside a VM

Steps to reproduce:

  1. Open the browser inside a VM that shares its clipboard with the host machine.
  2. Copy something on the host machine and then close the browser, the clipboard will be incorrectly emptied.

Previous discussion: #42154 (comment 2962522)