Fix stale index.lock file removal using "atexit()".