In the case of a pope living an openly sinful life, it would be best to trust that the Holy Spirit will protect the Church from such a pope falsely defining a matter of doctrine or morals. The Church has unfortunately had a number of leaders who have not led moral lives, but has never had any of them compromise the Church’s doctrinal or moral integrity. The Holy Spirit can be thanked for that and trusted to continue to protect the Church.
As for the more general question of praying for someone to die: I can’t say that it would be absolutely wrong to pray for someone’s death when that person is a positive danger to the lives of others, or when that person is himself suffering terribly and has no hope of cure; but I can say that such an action would certainly, at the very least, be imprudent. While there is life there is hope for repentance, cure, or preparation for a happy death, and it seems to be imprudent and uncharitable not to pray for these instead of for the expediency of death.