Astronaut takes spacewalk right before setting US record