Somewhere in the circuit there is a contact that is moving a little bit and that movement is causing the current to flow or not flow according to the position of the contact. My first guess is the little metal tab that makes contact with the metal on the bottom of the light bulb. Since the house is old, it may be challenging to be sure that the power is out when you go to adjust it, so my advice is to shut off power to the entire house before you make this adjustment.
To adjust the tab, remove the lightbulb and take something thin with a bend at the very end, such as a dental pick or a pick that comes with a nutcracker set, or anything else that can reach under the tab and bend it so it sticks out a little more. While you are doing that, check it for corrosion, and if you see any, scrape it off with something until you can see a good metal contact. Then bend in place and test. When you test it, be sure to use a "known to be good" lightbulb. This is one that has worked reliably in some other fixture without ever going on and off unless switched to do so.
If this doesn't solve the problem, I would inspect the switch for loose wires. check any wire nuts in the junction box behind the switch as well. If all are snug, replace the switch to see if that solves the problem.
If the problem still remains, remove the cover to the breaker panel (after shutting off power) and confirm that the black wire at the breaker is tightly affixed, and that the white wire at the neutral/ground bar is also tightly attached. If anything was loose, tighten and test. If all was tight, replace the breaker
If that fails, look to the source of the power feeding the switch, and confirm that the connection on that end is secure. Often that is the outlet closest to the fixture on a line from the location of the panel.
Best of luck!