range requests for non-seekable streams

Fix for range requests for non-seekable streams. With the old code the offset is not set correctly, as fseek doesn't do anything on non-seekable streams. This is a pull request for issue #441.