Make reference counted assignment check for races. am: 0e90812b64
am: 66c2e2ce21

Change-Id: I16eac4d5cf6586279d2f4a79e9713f405e1bad9e