Update APISession.java - public void Terminate()

regarding JENKINS-21587:
 
- Splitted code in Try-catch block to ensure execution even if one of the previous commands trows an exception.
- Extended debug logging.
 -Validated setting of APISession's "terminated" property