Let me see if I understand this. Is it the sin of cursing for me to wish, or state that I wish, for a grave malefactor (like Khalid Sheikh Mohammed) to be sent to hell? Or am I just asking for justice when I do that?
The short answer to your first question is: "yes."
God wishes all men to be saved (1 Timothy 2:4), and provides the graces necessary for that end, even while respecting our free will choices to accept or reject that grace. But salvation is a possibility right up to the moment of death, and one should never put himself in the position of desiring the counter to God's positive will (as stated in 1 Timothy 2:4, as above).
To do so is to make an eternal judgment on the state of another's soul, which God prohibits: "Judge not, that you not be judged. For with the judgment you pronounce you will be judged, and the measure you give will be the measure you get" (Matthew 7:1-2). Keep reading from there through verse 5. Yes, these verses are often misused to imply that we can never point out bad behavior in others, and 7:1 is probably the only Scripture verse libertines even know. But all of that is taking it out of context. The actual context has to do with taking-on the prerogatives of God as one's own, and judging people as worthy of condemnation to Hell. To do so, according to Jesus' plain meaning, is to risk incurring the same sort of harsh judgment on oneself.
Or consider the wording of the Lord's Prayer: "and forgive us our trespasses, as we forgive those who trespass against us" (Matthew 6:12). What you are doing when saying those words is asking God to deal with you in the same way you deal with others! If you desire eternal damnation of others, you are, in effect, begging God to mete out the same fate to you. Praying for "justice" is perfectly fine, provided you let God determine what that "justice" will be, without giving Him so many "helpful hints" about your predetermined destinations.
Again, God is our judge, and only He can truly judge justly, since all aspects and circumstances relating to apparent evil are known to Him alone. And, in any case, repentance is possible in anyone, even to the point of their last breath. Just ask Saint Paul, who was, prior to his conversion by God's grace, zealously complicit in the "judicial murder" of Christians. Leave the judging of eternal destinies to God. We all have enough trouble shifting for ourselves in this regard!