HP Inc. was proactive about the impact of tariffs, and it may be paying off