fix(modal): prevent error when closing non-opened

$modalStack.close() and $modalStack.dismiss() were assuming that openedWindows.get(modalInstance) always returned something and this might have led to thrown errors when trying to close a modal window who was actually not open.