As for bugs in the control code freezing your pipes? Well, just give the code as much care as you give to driving and you should be fine. ;)
(The serious solution to that is to have a dead simple failsafe controller that switches between on, off and auto, where auto is controlled by your crazy inventions.)
- At least in US, thermostats control is low-voltage (24 V AC), and come from low-power transformer which will just stop working on overload (ask me how I know :) ), so there is no electrical fire danger
- You never plug anything into the AC outlet directly -- you always use AC/DC adapters (and not the ones bought on ebay for minimum price, too)
- To prevent freeze hazard, you also leave original thermostat hooked up, but set it to really low temperature (10C/50F).
- Overheating house is possible, and you definitely need to consider this in your software (for example, require periodic control messages to keep your boiler on). However, I do not think it is an actual fire hazard -- likely, there are hardware safeties in your heater to prevent that. Still, if you are worried about this, you can install a second thermostat in series with your relay and set it to max temperature you ever want.
I used 2 ESP8266's - one in the temperature sensing and control box in my office, and one controlling a relay inside the boiler. When it's too hot the relay is opened to switch the boiler off, when it's too cold the relay is closed to switch the boiler on.