Change Where We Set NP_RUNNING On DNS Check

We were setting the NP_RUNNING flag to true too late, then back to
false too early. Change it to set this flag at the proper time.