It's an interesting question to apply the Categorical Imperative and Kant's moral philosophy to the case of slavery and specifically as to whether one should manumit one's slave.
There are several difficulties in how you formulate the question that also need to be addressed:
... I trying to act according to the categorical imperative.
While I understand what you mean by using this construction, there's something inadequate about this wording if we're going to be true to Kant and his idea of the enlightenment. The main potentially problematic phrase is trying to act according to.
There's two issues, first, this seems to present the Categorical Imperative as something outside yourself. For Kant, this is the definition of "heteronomy" an issue he addresses indirectly at one point in the Groundwork (the shopkeeper example) and directly in the "autonomy" formulation of the CI.
The second issue is that this presents this as "trying." This might be okay depending on what exactly is meant, but for Kant, there is no standard of trying, there's do and don't. A basic reason is that for Kant, the Categorical Imperative is nothing other than what pure reason dictates in the moral realm (this is stated in the preface to the Groundwork).
... I am considering the action of releasing this slave so that he is happier.
There's a big problem here in a place you might not expect -- "so that he is happier." In the Groundwork, Kant distinguishes between hypothetical imperatives and the Categorical Imperative (he's confident there's just one and it's unified and its complete based on pure reason). "happiness" is, according to Kant, an end everyone has but that remains hypothetical.
A second thorny issue also occurs in passing. For Kant, the form that an individual's will takes is maxims which it imposes. When these maxims accord with universal reason (either reason itself or reason in the form of laws of nature applied to the world), then they are moral and agree with the categorical imperative.
But as indicated, the maxim "I will make someone happy" cannot be perfectly identical with the categorical imperative -- since happiness is not for Kant a moral end per se (things get very complicated when you add Religion within the bounds of reason alone and Metaphysics of Morals into the mix on this question).
In terms of slavery, Kant does mention it briefly in some places, namely Metaphysics of Morals 6:330. Elsewhere, there's some work on his view of racial slavery. I must admit I'm not particularly up to speed on those particular references -- but since your question is about the CI we can skip many of them.
The way you formulate your question, you're operating from what is called the "universalization formula" of the categorical imperative. This has two specific forms -- logical contradiction and contradiction in a world where this is a law of nature. "world" for Kant is a technical term referring to something we make with our minds.
In Critique of Practical Reason, Kant says lying is wrong because we owe the truth to others. This can also be formulated in terms of universal law -- viz., that if we lie, then the purpose of communication disappears since we cannot discern anything from the gibberish that we are hearing. Admittedly, this isn't a pure logical contradiction (and several articles have critiqued him on this front). But it's hard to imagine lying being effective in a world if there was a rule that people never told the truth.
The same sort of universalization can apply to slavery in a world, but it might be a stretch for us to believe this works. This points to three things -- one that what we can conceive of as being possible might different from the Prussian Kant. Second, Kant tells us that there are other formulas of the categorical imperative -- some of which are going to get us much clearer accounts of why slavery is wrong. Three, that the equivalency claim in the previous sentence is somewhat dubious (an angle to critique Kant on).
The easier place to get the wrongness of slavery is "The Formula of Humanity." Here, Kant again gives two articulations (I don't have the page numbers with me), but they are: treat rational beings as ends-in-themselves and never merely as means and treat humanity in yourself and other as ends-in-themselves and never merely as means. (I argue in an unpublished paper that we shouldn't put so much stock in his use of "humanity" since he clarifies elsewhere this doesn't have much to do with being homo sapiens and just means rational beings again).
Slavery is treating someone as a means to your ends. In so doing, it fails to respect the rationality they have.Thus, it is wrong.
Lying can also be shown to be wrong on the same logic -- as used Critique of Practical Reason: that when you lie, you are misleading a rational being and using them for your own ends. (N.b., that in Metaphysics of Morals, Kant changes the argument against lying to one where the problem is that you are not respecting rationality in yourself by engaging in this irrational behavior).
As I mentioned above, Kant claims that the Formula of Universalizability and the Formula of Humanity are identically the CI -- along with a third formula about the Kingdom of Ends.
Regarding manumission, Kant has an ought implies can view. Meaning, if we can identify what is the right thing to do, we should do it -- practical difficulties be damned.