Fixed dismissModalViewControllerAnimated: behavior

- If the controller is presenting another controller, it should dismiss that one
- Only when the controller is not presenting another controller should it ask
  its presenting view controller to dismiss it