moai.FreeDialog() will first detach the dialog from the application object and then
free it. So technically speaking, this function is just a convenience function which internally
removes the dialog object from the application object by calling Application.RemoveWindow
and then calls moai.FreeObject() to free the dialog object.
simply combines these two steps into one.
See Dialog class for more information on dialogs.