Guinea pigs are similar to rabbits in hiding illness (as prey animals) and dying alone. Of the three I've had that have passed, two died while alone (one while I was at work). The other, who was young and had a heart condition, seemed like he held on until we were there. All the deaths were difficult for me, in different ways. I hope the two I have now are with me for a long time (well, long for guinea pigs--they tend to have a life span of 5-8 years, and mine are 2 years old).
And Rascal was likely doing what came naturally to him (of course cats aren't prey animals, but they are animals and follow certain instincts). I agree that he probably was thinking of all the nice moments with you.