Use fseek if possible

Suggested in #1 use fseek. But only when the stream is seek-able.