fix async case.

When receiving asynchronously the stored pid can have been removed.