[DIC]: Detect and guard against ciruclar references

If an object definition contains a self-reference it will inevitably caught
in an infinite recursive loop.

Add tests to cover self-reference cases.

Change-Id: I22410876e084770562d81ebc06094ed3fd49b63d