pescan: Adapt TLS functions to mmap version. Resolves #54.