Fix reference count for detachted actors

Fixes #166