Fix an occasional hang with non blocking socket

Before that an occasional hang occured in recvfrom()
Also an extra newline was getting printed for reasons beyond me