d3d: Add basic stencil mask handling

Mostly so we have it in dxstate, will probably reorganize stuff later.

-[Unknown]