Added IsWindowClosed function to check if window is closed
Window is now correctly closed when window is closed
FrameQueued is now fired when rendering loop completes