Fixed json stringifying with circular object references.

Errors caught via domains exhibit this issue.

http://stackoverflow.com/questions/11616630/json-stringify-avoid-typeerror-converting-circular-structure-to-json