And consolidate more code from xwl_present_timer_callback and xwl_present_frame_callback in it. (cherry picked from commit 2bfc46d4)