Perhaps Onesiphorus was alive and simply away from home. So Paul had an urge to pray for his companion's family. What we can gather from this text is that the two were not together at the time. One resource says the following:
"Knowing that even these good deeds could not save Onesiphorus and his house, the apostle asks the Lord to show mercy to his friend — to keep him in the grace of God that he might persevere until the very end."
This makes perfect sense because Christianity was persecuted under the Roman Empire. A prayer for perseverance to the end would, by definition, mean that he was still alive.
"It is, at any rate, clear that such a simple utterance of hope in prayer, like the Shalom (peace) of Jewish, and the Requiescat or Refrigerium of early Christian epitaphs, and the like prayers in early liturgies, though they sanction the natural outpouring of affectionate yearnings, are as far as possible from the full-blown Romish theory of purgatory."
Onesiphorus received complete forgiveness of sins at the moment of his conversion. If he was dead when Paul wrote 2 Timothy, then his fate was already sealed. No amount of prayers could possibly alter or help his eternal destiny. Paul was neither praying to him nor supporting the idea of anybody else doing such. He was not praying that Onesiphorus would be released from purgatory or anything in those lines.