Thanks for the experiments. I'll look into the first one, but think the second one is normal behavior.
When you lock a texture, its UV coordinates are fixed to the vertices. All information about the original texture angle, scale, and position is lost. When you switch texture lock off, the information is recalculated from the UV values so that the texture normally stays unchanged. But due to mathematical ambiguities the angle, position and scale are normally different to the original values.
This is a principal problem and mathematically not solvable. The alternative were to reset the texture to default position when texture lock is switched off. but I think this is not desired by the user.