Fix discarding of comments in the diff viewer when double-clicking flags.

When double-clicking on a line number to add a comment in the diff view, this
is registered as two seperate clicks. The comment dialog opens on the first
click, and then on the second click the dialog is closed, the comment is
deleted, and then the dialog is reopened (but no new comment is created). So,
clicking save would not save the comment.

To solve this:
Before the comment dialog is shown, first check to see if there is already a
comment dialog active. If there is, and it is a comment dialog for the same
block as the one that is about to be shown, then don't show a new comment
dialog (keep the old one as it displays the same comment). A double-click is
registered as two clicks for the same comment block, and so the first click
will show the dialog, and the second will do nothing.

Testing Done:

Tried all of the following (in Firefox, Chrome):
 - Adding comment by double-clicking on a line number and comment flag
 - Adding comment by single-clicking on a line number and comment flag
 - Adding comment by selecting a range of lines

All JavaScript unit tests passed.

Bugs closed: 3437
Reviewed at https://reviews.reviewboard.org/r/6340/