udp: Add assertion for preconditions for direct detach