It's one of those ones where your play was pretty solid, and folding may well have been the right choice. It depends on the player, though - if he's the kind that would play a non-nut hand, then I'd have been inclined to call, but it is tough.
It's purely a judgement call, at that point - it could easily have been a semi-
bluff with trip kings, which would have left you in reasonable shape, you'll never know.
Getting off a big hand isn't easy, though, and even if it was the wrong choice, it's a good skill to have.