Fix bug introduced in dd26871, when call shutdown() right after send() from non-IO thread, data might be incomplete.