Fix #3327: "Unable to find debug data" when logging objects with circular references