Use long for file offset computations

Fixes #2808