making STUN discovery more robust
fix a chunkstream error: infinite loop if the chunkstream is closed badly