Lock the session file when opening it