linux: reverse size/nmemb in fread calls so that we return the number of chars that were really read