Hurricane Arthur gained strength in the Atlantic on Thursday and threatened to strike near the North Carolina coast on Independence Day, prompting thousands of vacationers and residents to leave parts of the state’s popular but flood-prone Outer Banks.