Fix TSO lock file check when running the script

Correctly check if TSO is already started by testing the PID file
presence.