See http://fiji.sc/bugzilla/show_bug.cgi?id=1022
ImageJ 1.49q5 will add a quittingViaMacro method which bypasses the save dialog for dirty images when quit is called in a macro.
We will want to handle this similarly to the general quitting mechanism, whereby we either iterate over all windows manually to close them, or consider disabling this flag.