Fix offest calculation when part of requested data is in memory buffer
Created by: szarsti
I found a bug in my earlier patch to read from cache and disk simultaneously. In rare circumstances when requested period was shorted then buffer, offset was wrongly calculated.