This buyer’s guide to backpacking and hiking pants highlights models optimized for functionality, comfort, and protectiveness.