avformat/udp: Close the socket after destroying the thread using the socket

for send() this cannot work and even for recv() it feels very wrong and hackish

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
