[PATCH v2 1/6] d3dx9: Factor out {lock|unlock}_surface() functions.