Fixed dismissal code for iPad when activity controller is NOT presented ...

...via popover.

The code would crash on iPad if the UIActivityController was presented without a popover.  This code fix does a check before attempting to dismiss the popover.