Unchained: Fix MacOS crash when alt-tabbing

A fix has been implemented to diminish the crashes in Mac OS when switching focus to another window.