File transfers over IRC sometimes failed because the sender `close()`d the socket before reading everything from it, resulting in a TCP RST packet being sent, which was interpreted by the receiver as a problem with the connection, sometimes dropping the last few bytes of the file as a result.
This patch reads everything from the socket before closing, thus avoiding the RST packet issue.
Testing Done:
Tested on Windows, Linux, Windows-to-Linux and vice-versa IRC file transfers.