Add graceful termination for ssh executor
For the ssh executor when we want to finish a process we simply send
SIGKILL which might lead to processes not being terminated properly as we've seen with other executors such as #6359 & #3376 (closed).
SIGTERM first to the processes and then after a specific timeout send
SIGKILL. This will help processes and give them time to clean up their resources child/processes.