Fix bug in handling errno from lseek()