udprelay: add tcp relay support

This rather invasive looking patch splits the UDP handler out into its
own function and adds a similar TCP handler which listens on a port and
forwards framed TCP packets.  If there is an error in the framing, the
connection is closed.