xbps_file_hash: simplify and use read(2).