Replace XCB native interface resource map by a lookup function.

Remove global variable and duplicated lookup in the old code
(map.contains() followed by map.value()).

Change-Id: Id68c34bf38c6706db69dcb8422c3b1ea718aa064
Y# issue or contains a behavior change that is relevant to others,
Reviewed-by: David Faure <david.faure@kdab.com>