Fix access to invalid data on reception of packet with size 0
Log unhandled exceptions in connectionthreads to errorstream