Fixed possible threading issues.

send_lossy_cryptpacket() can get called from another thread meaning
the connection can be killed while the packet is sending.
Adding a new connection while a lossy packet is being sent could
also cause thread related issues.