Most probably from the days when one sailor aboard ship was employed to throw a weighted rope into the water in order to determine the water's depth. Presumably that was an easier task than scrambling about on the rigging etc and hence it took on the meaning of skive, shirk or malinger.
Repeatedly taking soundings and retrieving the weighted rope could be hard work. Just swinging the rope to and fro, without actually letting go was a lot easier, while hopefully giving the impression that soundings were still being taken.
Thus 'swinging the lead' came to mean taking it easy whilst giving the impression of being hard at work.
Heathfield may well be right - I don't know, never having swung the lead either literally or metaphorically in my life! - but Albert Jack, in his book Red Herrings and White Elephants on phrase origins has this to say about the leadsman's work...
"As the easiest job on board it was usually given to the sick or injured and many feigned illness in an attempt to secure such light work."
Whichever interpretation is correct, it involves malingering/skiving!