Fix bug 1160644
Fix bug 1119790
When try to serialize an exception object as json, it failed
with 'ValueError: Circular reference detected' that is same error
as bug 119790. So this patch fixes bug 119790 too.
Change-Id: I0da2616f4ec59da31be054b8be2f7a140f59d63a