i965: Share most of the WM functions between brw_wm_glsl.c and brw_wm_emit.c