Refactor update_window_begin and update_window_end hooks
Bug#35464.
* src/dispnew.c (gui_update_window_begin, gui_update_window_end): New
procedures implementing common functionality.
* src/nsterm.m: (ns_update_window_begin, ns_update_window_end):
* src/xterm.c: (x_update_window_begin, x_update_window_end): Remove in
favor of only using the new generic versions.
* src/w32term.c: (w32_update_window_begin, w32_update_window_end):
Remove duplicated and unused code.