Fix `UnboundLocalError` when failed to authenticated using SSH with EC2.