Avoid two queries per request to get type OIDs.

Do 1 query once at first connection initialization and store
the result in memory forever.