Yes, but I think (3) is really rare - closing documents is typically done by users; if plugins do that, it would be very unexpected. That doesn't mean there couldn't be some races like that when a user closes a document, opens another, and only after that an asynchronous operation with a doc argument finishes.