face: Prevent infinite loop in TcpFactory and UdpFactory

Change-Id: Idd694bc08033c524f3c0e569ed74341aa33fce31
Refs: #2292