Added safety check for if UIViewController is being presented when trying to dismiss

I noticed that if the I use FCOverlay to present a loading view will performing a network request and the request finishes and dismiss is called while the viewcontroller is being presented then the viewcontroller does not get dismissed. I have added a fix for this.