Closing them is easy. Getting to them is the hard part. They need to be closed from the inside.
In order to remove the masthead, both the forestay and backstay need to be removed. Also any instrumentation and lights mounted on the masthead fitting.
Then, the masthead itself is held on with ~8 SS self-tapping screws through the mast. These will be heavily corroded in-place and may break off.
Unless you're up for a McGuyver'd temporary rig, and superhuman acrobatics aloft, this really means that the mast needs to be down for this modification. I did it as part of a total mast rebuild, which included getting the masthead fitting (along with the whole mast) sandblasted and repainted with Awlgrip.
Once I had a nice clean surface to work with, I figured anything non-wood would work. Didn't need to be strong, just watertight and rot-proof. I cut two small rectangles from a scrap piece of plexiglass and secured them in place with Dow Corning 795. This industrial-strength Silicone has significant adhesion strength, unlike consumer-grade hardware store silicone.
Like I said, a pretty easy fix, once you get to the bottom of the fitting! :-O