nine: Add state tracker nine for Direct3D9

Work of Joakim Sindholt (zhasha) and Christoph Bumiller (chrisbmr).
v2 Small fixies and sync with latest Mesa by David Heidelberger (okias).
v3 Build improvements by Emil Velikov (xexaxo).
v4 Modified to use directly PIPE_CAP_VIDEO_MEMORY
instead of PIPE_CAP_DEVICE_MEMORY_SIZE.
v5 Merged few small fixes by okias
v6 define to not use indirect drawing
v7 allow D3DLOCK_NOOVERWRITE for LockRect, make Osu game works

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
nine: fixed problems with using more buffers than available

Hardcoded value 32 worked on nv50+ and r600, but on radeonsi or
others with <= 16 failed and asserted in debug mode.

Reported-and-tested-by: Nick Sarnie (sarnex) on IRC
Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>