fixed negative number of active dialogs, fixes angular-ui/bootstrap#496

fixes angular-ui/bootstrap#496