When to pay off a loan early—and when it’s better to keep paying gradually