I recently lost a batch of beer when the krausen (the top layer of yeasty foam) completely filled the headspace of my fermenter and vomited through the airlock. By doing so it displaced all the liquid in the airlock, leaving it dry (and filthy) and it also filled the fermentation fridge with half-fermented wort. This of course went entirely moldy and rancid.
The solution this time around is to replace the airlock with a blow-off tube. This setup is essentially a junior version of what they have installed in commercial fermenters. The tube runs out of the top of the fermenter and into a plastic bottle full of sanitizer.
I found that 6mm vinyl hose from Bunnings worked fine, although it did need a few turns of electrical tape to increase the diameter sufficiently to make it fit snugly in the grommet of the fermenter lid. The whole thing got flushed with sanitizer before the free end was placed under a volume of spare sanitizer in the soft-drink bottle. A little more tape holds the tube in place.
Should a blow-off occur, any krausen should simply accumulate in the bottle full of sanitizer and no airlock will be lost.