Fix incorrect bytesWritten computation in AsyncSocket