Motor.lock() has always worked for me, could you try testing it with less stress on the motor (just to see if it has any affect at all).
Failing that, is motor A the correct motor? Could you swap the current motor for another motor? Is the lock command being overwritten later in your code by another motor command?
If your still stuck post you code, that might help.