Fixes #43 with closing a popup.

Fixed bug where $().UIClosePopup was throwing an error when it didn’t
find a popup. Better error checking now.