Fix memory leak in patch server.

Before this change, a condition that caused accept to fail would
fail to deallocate the client and we would be left with inaccessible memory.
Small misc cleanup and centralize client disconnects.

The disconnected variable is only used in these handlers but I've
decided to keep it there for flexibility later if the need becomes
apparent to be able tp specify that a client is disconnecting soon.
Modify packet handlers so that their return values are consistent.
Improve comments in receive_from_client.
Standardize return types and actually use return value of packet handlers.

This was an overlooked todo that now enables the server to respond
apropriately to errors in sending packets to the client (namely
by just disconnecting them).
Minor cleanup in patch_packets.cc; no functional changes.
Modify return value and docstring of sending_client_file.

Function will not return 0 instead of 1 when the list is empty,
which is consistent with the C standard and also a little easier to use.
Dynamically allocate memory for calculating file sizes.

The program was crashing on files over ~8MB, which I believe was the
result of not being able to store that many consecutive bytes on
the stack at once. The issue is now resolved by malloc'ing and free'ing
filebuf instead of relying on the stack.