core: poll for process exit on SSH#exec with subprocess