The code was already essentialy C, just needed to replace the pairs with
structs and the vector with an array, it was fixed length anyway.
The code feels more natural in C.
According the XCB documentation the reply structs must be freed. I found
this when running a minimal example related to the direct mode code in
valgrind.