There is no code in the background page for disconnecting the ports opened here. Hence, the only reason the ports will close with the current background scripts is if the background script is being closed by the browser. This only happens if
* the extension is being updated
* the browser is shutting down
* the extension has been disabled from the chrome://extensions menu

In all these cases, we want to stop running the current versions of the content scripts running, so that's what we do here.