python subprocess stdout readline hangs