[PATCH v3 06/20] util: Add read_remainder() and read_all_buf()