When typing a caption with a link, into the media dialog, if I hit [Esc] twice in order to cancel the link inspector, it closes the entire media dialog.
See screencast attached: (1.4mb - if you can't see it here, right-click "save link as" on the "view file" link at top-right of F182277).
Steps to reproduce:
* Open media dialog.
* insert image
* start typing caption
* begin to create a link, but then change your mind and try to close it with [Esc] key (once if you haven't typed anything in the link inspector, or twice if you have)
* whole media dialog closes.
In contrast, clicking [Esc] twice within the link inspector (once you've started typing in the link inspector, or clicking once if you haven't), whilst editing an article, will just close the link inspector.
Confirmed in Firefox 38 and Chromium 37, on Ubuntu. Originally reported on Firefox 38 on Windows (?).