Keep track of the reference count, don't make the wrapper object weak when there are pending write requests. Fixes a regression from c79d5163.