pgmdump: bit of reorg to make it easier to split a2xx/a3xx shader

The format of the vertex/frag shader sections in the program-binary
format seems to differ between a2xx and a3xx, even on same version of
blob driver.  Split some stuff out into a struct to make it easier to
split up dump_program().
tests-3d: some fixes

Newer blob driver is a bit pickier about re-using a program from a
different context.  So don't do that.