Fix bug with MAME freezing when exiting from the 3rd fullscreen window with -video bgfx. Probably linked to library release on exit.