Check for current promise instead of document.

Keep track of the last promise which inspectFile returns to prevent any
stale promises from updating the UI.