Cleanup in the action handler

On the iPhone idiom the UIPopoverPresentationControllerDelegate methods
are never called. So there is a memory leak and also we never decrement
the activeAlertController count. This fixes it by calling cleanup in
the action handler
Merge pull request #6473 from vishalduggal/optionDialogFix-35X

(3_5_X) Cleanup in the action handler