This is a biological/economic issue. Without addressing either one of two, you don't solve the problem. Let me layout the full scope of the issue. Let's start with defining rape, why it happens, and ways that have been used throughout history to prevent it.
If you're going to talk about sex slavery, you must talk about the action it revolves around, rape. I've had some friends raped before and I think this topic should be explored further to figure out how to end it.
If you don't want to read you can scroll to the bottom.
According to some researchers rape is caused by both biological/psychological reasons. Randy Thornhill, an anthological researcher suggested that biologically inter-individual sexual acts were a means of survival in many different species. In a paper he wrote, he stated " In the case of direct selection for rape, selection may have favored raping because rape had a net positive effect on rapists' reproductive success. Despite its costs, rape increased mate number and thereby reproductive success of males."
It becomes a bit clearer when you see the same actions cone from other organisms like Scorpion Flies, Ducks, Dolphins, and other cousin primates. All of those species use rape as a means of reproduction.
Does it make it a good thing? When applied to a species' survival, yes. For humans, not so much.
What originally began as biological necessity for survival became a psychological problem within a little as 40,000 years. Most of those species use rape as a means of survival because they have a high mortality rate, but when we humans became apex predators and created society to prevent a lot of deaths, rape became biologically unnecessary. It leaves one to ask, why does it still exist?
Further along in Randy Thornhill's paper he stated the following:
"There are at least six hypothetical psychological rape adaptations: (1) a psychological mechanism linking the vulnerability of victims to the use of rape by men; (2) a psychological mechanism linking the lack of resources (or the associated variable of a lack of sexual access to females) to the use of rape by men; (3) a psychological mechanism causing males to have a different preference (in terms of sexual attractiveness as indicated by age) in rape victims than in consensual sexual partners; (4) a psychological-physiological mechanism producing changes in the sperm count of ejaculates during rape (or to depictions of rape) that show specific functional design for rape; (5) a psychological mechanism producing differences in the arousal of males to depictions of rapes than to consensual matings; (6) a psychological-physiological mechanism producing marital rape as a sperm competition tactic."
I know that was long, but bare with me.
Causes 1,4,5,6 can only be changed by changing our biological processes. Causes 2,3, also the most likely, can be changed easily. You change the way a person perceives someone, and you improve the sexual availability for humans, things are instantly solved.
In the past, we humans have used things such as laws and religions teaching either monogamy or marriage and consent with multiple wives. The most effective is making sexual interactions more available economically.
He's some reason why each works to an extent.
1) Laws scare some people from the act, but they fall short because the extremely motivated people are encouraged to not get caught instead.
2a) Monogamy makes acts with somebody other than one's designated spouse feel wrong. People tend to avoid the bad feeling because of it. It falls short because it makes people crave more.
2b) It forces a make to commit, but economically a hideous thing. Could leave a man to take care of too many women and children.
3) If we've learned anything through history, it's that placing wars against anything that happens naturally doesn't work. Just as the 1920s prohibition failed to prevent people from using alcohol, making prostitution illegal doesn't prevent sex slavery or the act of prostitution.
In fact, just like how prohibition caused gang violence, police brutality, organized crimes, and the rise of both cocaine and heroin usage in the US because the same people selling alcohol sold the other shit, making prostitution illegal is actually the cause of underground human trafficking.
Countries like the Netherlands figured this out and created the red-light district where prostitution is legal and highly regulated to ensure safety of a decent percentage of prostitutes, give them money to have a decent life, and tax that industry to charge their economy. Some other advantages, they waste fewer resources criminalizing prostitutes, and are able to regulate who gets to do prostitution based on ages and STDs. Some people could make a career out of such an industry.
By no means do I see that as an incredible solution, but I do see that as a reasonable one.
4) Creating a home where women could be safe could work, but the threat of attack is harsh.
The Perfect Solution:
The perfect solution is to build robots that look, act and sound like humans for prostitution. With recent projects from DARPA's Boston Dynamics, and new projects from Google, I think that's very feasible. Start working on the mechanics of it and you'll be on to a good track.