Workaround Linux kernel bug in generic_file_llseek_size()

The Linux kernel generic_file_llseek_size() function handles whence
values in a switch statement, but it lacks cases for both SEEK_SET and
invalid values. This causes it to treat all invalid whence values as
SEEK_SET, which is wrong. We implement a workaround by explicitly
checking each case.

Further details are available in the Gentoo bug tracker:

https://bugs.gentoo.org/show_bug.cgi?id=473444

Signed-off-by: Richard Yao <ryao@gentoo.org>