fix syntax for killing the monitoring script (#82390)
### Description
Previous if statement didn't work because of syntax
### Issue
<!-- Link to Issue ticket or RFP -->
### Testing
Made a dummy workflow on personal repo to see what syntax works
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82390
Approved by: https://github.com/kit1980