endpoint: steal the endpoint link from the list before destroying it

The wp_endpoint_link_destroy API removes the link from both endpoints. If this
is called in the endpoint destructor, we need to make sure the link is not in
the endpoint link list (by stealing it) to prevent the API destroying it again.
1 job for fix-endpoint-link-destruction in 5 minutes and 28 seconds (queued for 7 seconds)
Status Job ID Name Coverage
passed build #955972