Merge "Actually close sockets when stopping the receive thread." into mnc-dev