How can I lock a gear barrel adjuster that keeps moving?
One option is to tighten the existing adjuster completely, turning it into a stop.  Then fit an in-line barrel adjuster which will sit in a length of outer (ie, not against a stop)




Some 2 pot epoxy mixed, or a metallic paste like JB Weld would make short work of the existing adjuster moving.



Option 2 might be to replace the adjuster completely.  New ones are relatively cheap and look something like this:



Just be sure to get gear adjusters, not brake adjusters because they're based on a different diameter of the outer cable, and a gear cable will be sloppy in a brake adjuster.

You'll want to chase the threads in the frame stop with the correct sized tap too.  If there's not a lot of metal material left in the frame, then it may come down to replacing the cable stop, or finding some way to use a small nut and bolt the adjuster on through the now less-threadded hole.



Option 3 - swap out that cable stop for a loop, and run a single length of gear outer housing from shifter down the down-tube to the front mech.  May need to resort to cable ties to hold the outer to the bike.  Depends if you have a way to stop the cable further down.  There's a Problem Solver's stop that may help, but this would need the in-line adjuster already mentioned too.