add timeout logic

I think that it is necessary to add timeout logic at pyhs2.

If there is no timeout logic, there is a risk that job continue to run and can't stop.