Astros hit 3 homers to outlast Rangers 6-5