continuum_save.sh: Improvements to locking code
continuum_save.sh: Improvements to locking code

* moved the locking to a separate function "acquire_lock"
* changed $[ ] to $(( )), for consistency with the rest of the file
* taking the lock only after checking all other preconditions (they are non-mutating and thread-safe)
tmux-plugins/tmux-continuum