Move L2CAP socket IO processing into the socket for a cleaner interface and to reduce code duplication.