Check the wires at the diff where the speed sensor is. One (or both) of the wires to the connector are worn, and as soon as you touch one it will break. There is a repair kit for it, but I don't know the part number. It was installed by a local mechanic for me when I was getting a track inspection.
What's happening is that when you accelerate or decelerate the diff is twisting a little, and wiggling the nearly-broken wire.