Fix missing unlock and use uintptr instead of *os.File