Prevent dead loops on uncaught errors.

- Catch errors from logger's async calls via domains.
- Try to write such errors via fs.appendFileSync call.