Obama, troops cheer each other in Afghan visit