terminal.js:  Fixed a bug where closed terminals weren't being removed from the DOM.