Win32 message loop optimization

Let the thread sleep at each frame's idle time. It can save a lot of CPU cost when the application is minimized or running a simple scene.