Put a hard limit on the size of a read

Only read a max of 64k at a time, rather than trying to read the whole
max frame size.  This will limit memory usage and also avoid blocking
for too long on a single read.