Bug 1160752 - Make apache-vhost more atomic

* Write one buffer to file rather than a number of writes
* Truncate conf files rather than removing them to ease up httpd
  failures on restart