ftell() returns -1 on an error, so it must be a long return type, and we should test for its failure. (found by Coverity)
Part of fixing https://gitlab.com/kicad/code/kicad/issues/3637