driver: fix polygon depth bias

Number of units was wrong. This fixes shadows in quake.
driver: flush before some state changes

There seems to be some corruption caused by changing certain states
without a cache flush. This is especially visible in quake.