Fix read offset check for inmemory driver

cc: @stevvooe 
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>