Added an outbound packet lock as well as ensured all buffered outbound data is sent