A small selection of loader fixes which started as reviving kms_swrast support in egl/gbm.
Since the majority are conceptually on the same topic, I've opted for a single MR.
/cc @ajax @eric @anholt