Fix pass counter not applying properly

Fix texturefx releasing locked resources too early