Fix for concurrent append in VanillaIndexCache

Concurrent access to the append method was causing
a buffer overflow failure because the position was being
incremented by another thread after the check for end of file.