Reference counting made atomic