update modal list when necessary

This should fix the problem about modals not being hidden correctly when allowMultiple is false (https://github.com/Semantic-Org/Semantic-UI/issues/412). The modal list is updated when needed.

I don't know much about semantic's code philosophy, so I don't know if I coded it the right way. However that does the job. At worse I hope it will help someone to fix it properly :)