libfreerdp-core: improve primary order encoding