tcp: add new tcp ctp

Copy sock and rename everything from sock->tcp
Compiles, probably doesn't run
Merge branch 'master' into topic/tcp
tcp: compiles, does not run

Next, need to work on poll and handling the resulting
events.
Merge branch 'master' into topic/tcp
tcp: be sure to poll for HUP as well
tcp: implement connection handshake

Implement connect, accept, and handlers for CONN_REQUEST,
CONN_REPLY, and CONN_ACK messages. Still needs reject()
and actually sending messages.
tcp: handle MSG and ack it if reliable

Also, add locking around all sends using ep->lock. We can
switch to tconn->lock later if needed.

Abstract receiving messages to simplify code.
tcp: compiles runs, hangs in connect

MSG path is nearly complete. Not reliably catching events
via poll.
tcp: pingpong runs with R* MSGs
tcp: set the conn atr before checking it

This fixes the UU case for MSGs. Both pingong and stream
run with MSGs. Both client and server segfault during
cleanup.
tcp: only join a thread that exists

When in polling mode, do not create a thread. If no thread,
do not try to join.
tcp: report ENOBUFS in get_event() if no rxs avail

Also, store access flags in the RMA handle. They will come in
handy when checking for permissions.
tcp: RMA write mostly works

Need to handle the case when send() returns less than the whole
fragment. Will move queued and pending messages to the connection.
tcp: switched send progression from tx to conn

Since TCP does not include markers, we must ensure that we
progress sends in order until they are complete. There is no
guarantee that we will send a whole MSG or RMA fragment, so
we track how much we have sent and try again the next time
through.

The receiver will keep trying to recv until the entire MSG or
RMA fragment arrives.

With this commit, R* connections pass pingpong for MSGs and RMAs
up to 128 KB. It stalls above 128 KB.

UU conns fail in pingpong with ENOBUFS on the server.
tcp: fix RMA Write

pingpong with RMA Write works. Segfaults at end on the client
probably due to the sever hanging up.
Merge branch 'master' into topic/tcp
tcp: try to reuse listening socket

Also, properly account for number of fds returned from poll.
Add a check to avoid overrunning the connection array to catch
the OSX poll bug.
tcp: sendto() now returns SUCCESS or error, not length

This fixes the UU MSG path.
tcp: RMA Read works
tcp: fix memory leaks

Remove a lot of dead sock code