Fix reading other than regular files in file_io.h (#594)
Fix reading other than regular files in file_io.h (#594)

Reading from regular files is simple because we can obtain the size of
the file first and then read the whole file to a buffer at once, but
when the input is given as a pipe (like in `cat file | cjxl - foo.jxl`)
the size is unknown. We had a special case for reading from "-" one byte
at a time, which is unnecessarily slow and didn't cover all cases.

This patch uses a list of 16 KiB chunks when reading from a file whose
size is unknown. This includes both stdin and named pipes.

Fixes #591
libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl