x86: move and fold common code in build_modrm_byte()