Followup updates to #4581 and #4598

* For #4581 it now reverses the list of suits when running the before first functions, so that the before first functions from the top most suite runs first.
* For #4598 I improved the closing of the FILE_CLOSE_ALL dialog, reusing `cancelModalDialogIfOpen`.

@jasonsanjose Want to review this? No rush thought, since the changes are just minor updates.