Fix network protocol/endpoint lock order violation

IPv4 would violate the lock ordering of protocol > endpoint when closing
network endpoints by calling `ipv4.protocol.forgetEndpoint` while
holding the network endpoint lock.

This cherry-picks https://github.com/google/gvisor/commit/2db8f748593c0.
Bug: 73353

Change-Id: Ie27524191f65175ef18c71c215e6312f1cebcba4
1 file changed
tree: 0c90238c3a3e08f4bf669ade7eee2f6c79d8174b
  1. pkg/
  2. AUTHORS
  3. go.mod
  4. go.sum
  5. LICENSE