Generic method to avoid server crash.

domains seem to be an [unstable API in node](http://nodejs.org/api/domain.html). I like the approach though. It'll be less crashy.