Flood prevention in laundry closet
I'm adding this as answer because I really think this is a solution that will work for you, even though as written, I really can't call it a duplicate.

Check out this question and related answers: How can I turn off the power to an outlet if a water alarm is triggered?

The basic idea is to get a device that cuts power to the washer if water is detected.  This will minimize any damage from a broken drain line since the machine will stop pumping water when the power is cut off.