There is a product called WaterCop that will do the trick, but it may be more than you need. See below: http://www.watercop.com/watercop/
I have seen an ad for something similar that plugs into the same electrical outlet as your washer, and it has electronic shutoff valves for the hot/cold water. It looks like it is easier to install and less expensive than WaterCop, but it is just for washers. I can't find the ad and I can't remember the name. Happy searching, and good luck. Post back if you find it -- I may buy one myself!