They should not come loose if you have locked them.
Here is what to do lower the leadscrew down so you can get at both the bottom acme nuts, take 2 adjustable wrenches and when the top of the two is in the right position hold it still with one wrench, then with the other tighten the bottom nut against the upper as hard as you can, this will stop either moving.
Move the leadscrew back up into position, fingere tighten the lower of the top two nuts against the bearing then as per the bottom, hold that nut still and tighten the top nut against it to lock it.