New congestion control algorithm.

This new congestion control algorithm uses the increase in size
of the send queue to regulate how fast it sends data.

When tweaked it should work better than the old one.
Some thread safety related fixes to TCP connections in net_crypto.

Added a recursive mutex to fix possible thread issues when the A/V
thread sends data at the same time as the main thread.