issue #1947094 by kaidjohnson: fix Closing Media Browser dialog with Escape causes orphaned HTML to hang around