Now properly locking the d3dcontext inside present.