When I was working on a dump truck regularly, I fabricated a positive lock from a piece of heavy wall pipe. I split the pipe lengthwise, added hinges on one side, and used the assembly to surround the hydraulic cylinder ram. Angle iron flanges on the opposite side from the hinges allowed me to bolt the lock securely around the ram. I added big flat flanges top and bottom to distribute the load evenly and avoid damaging the cylinder. Just choose a pipe diameter big enough to clamp around the cylinder shaft.
Jerry