fixed problem where close method could chain onto itself

In a case where a predefined "options" structure  is passed in it is possible that the close method will be called twice on the second and
subsequent calls to the dialog service.  For example, if you have a dialog and open it with a set of options and then close the dialog; it worked
fine the first time.  But the second time you opened the dialog using the same options structure the close method had been modified
by the dialogService to include a call to the dialog service cleanup.  The second time the structure came in the dialog service cleanup was
appened again and again and ad infinium.

By making a shallow copy of the options structure before we modify it we avoid this problem.

We also added a check to the cleanup to make sure the dialog being cleaned up exists when called.