function dialogCloseAsync(dialog, asyncResult)
 {
    // issue the close
    dialog.close();
    // and then try to add a handler
    // when that fails it is closed
    setTimeout(function() 
    {
        try
        {
            dialog.addEventHandler(Office.EventType.DialogMessageReceived, function() {});
            dialogCloseAsync(dialog, asyncResult);
        }
        catch(e) 
        {
            asyncResult(); // done - closed
        }
    }, 0);
}
Closes the currently open dialog asynchronously.
This has an ugly workaround which is to try to set a new
event handler on the dialog until it fails. When it failed
we know the original dialog object was destroyed and we
can then proceed. The issue we are working around is that
if you call two dialogs back to back, the second one will
likely not open at all.
@param {Office.context.ui.dialog} dialog The dialog to be closed
@param {function()} asyncResult The callback when close is complete