wined3d: Update refcounts when storing references in IWineD3DStateBlockImpl_Capture. Move TRACEs to the top of their code blocks.