Vacuum seal them then put them in something else that would also be sealed.
I was about to mention this. I wouldn't recommend the old trick of sucking the air out with a straw, though! Don't just use a Ziploc or something like that; actually seal the bag with a lighter or whatever the proper tool is.
Instead of using regular glue on the endcaps, try model cement: it actually chemically melts the plastic and thus causes the endcaps and the pipe to fuse with each other. You might also consider wrapping the PVC tube itself in a plastic bag.
This would actually make for an interesting experiment if someone had some damaged or worthless guns, property, and the inclination. It may be worth doing some research to find out what people have done over the course of the century.
I don't think that burying them is your best bet, though. If your guns are hidden to such an extent that they're willing to break out the x-ray gear, metal detectors, and whatever else (is there such a thing as a gun-sniffing dog?), you're probably already in a situation where a gun isn't going to help much.
Of course, I could be completely misunderstanding you. If you're saying that you'd like to try planting a [insert reader's choice of detested firearm here] in properly fertilized soil in the hopes of reaping a P7M7, StG44, or Glock 18 then it may be worth a shot!