I was a bishop for 5 years. Here are some principles:
1. Sexual sins vary in severity ranging from bad thoughts to adultry. Masturbation is a very common indescretion. It causes feelings of shame and guilt. Though it is not the worst crime, missionaries should be free of it before serving.
2. Major offenses or things that are difficult to overcome should be confessed to the bishop.
3. While it is important to confess some things to the bishop, it is also important to not hang out all our dirty laundry for others to see. Many things should be kept to yourself.
4. Satan places doubt, fears and feelings of "what if" in our hearts to distract us. This is probably what you are feeling now. You are afraid to talk to the bishop but "what if" you will not be forgiven if you don't?
Here is what I suggest. I have no priesthood keys so it is only my opinion. If the problem is in the past, seek inspiration on what to do. This is done by looking beyond doubts, fears and "what if" feelings. The spirit is just behind these. It takes courage. It is very tempting to hang onto and analyze our fears but it serves no purpose and is a distraction by Satan who wants you to feel guilty. If you have sincerely put this problem away and you can find your conscience beyond the doubts, I suspect it will tell you to just forget about it. By doing this, you can learn to trust the spirit. Christ is very merciful to those who repent. He is not a hard task master who will punish you by making you jump through hoops.
If you cannot let it go, then talking to your bishop will put it ot rest. Don't continue to carry this weight. I assure you that the bishop is totally understanding of this.