Major averages close higher, Dow scores third-straight weekly gain