Timeout fixes

Take screenshot when worker is inactive for too long or tests timeout for a worker.