James 5:16 isn't phrased as an ultimatum. When it comes to confessing wisdom has to be exercised. What if you confess things to a brother that causes him to stumble? Would it be wise for a man to walk up to a woman in church and confess that he's had sexual thoughts about her? What kind of negative impact might that have on her?
Concern noted. I figure if we are sensitive to the Holy Spirit's voice we will know if, when, how much, and to whom. He has stopped me sometimes, perhaps just for the reason you mention, I dunno.
For myself, if the sin is against another I do my best to go to them directly and ask for forgiveness. Note that 1 John 1:9 is a promise from God irregardless of their willingness to forgive. He cleanses based on our faithfulness to Him alone.
Otherwise, I have an inner circle of one proven Brother and one proven Sister that I go to if I'm struggling to shake it off even after going to God. Those situations are actually rare, and again only as prompted by the Holy Spirit.
Mostly though, it's between me and God, Jesus, and the Holy Spirit. Even then, as we all know well, I'm certain that I'll miss some. That's why I ask Him at the end of each day for two things:
Shine a light into every dark corner:
Psalm 139:23-24 NIV
"Search me, God, and know my heart;
test me and know my anxious thoughts.
See if there is any offensive way in me,
and lead me in the way everlasting."
And then wash my feet for the day so I remain clean (and be available to any brethren asking for help washing theirs):
John 13:12-17 NIV
"When he had finished washing their feet, he put on his clothes and returned to his place. “Do you understand what I have done for you?” he asked them. “You call me ‘Teacher’ and ‘Lord,’ and rightly so, for that is what I am. Now that I, your Lord and Teacher, have washed your feet, you also should wash one another’s feet. I have set you an example that you should do as I have done for you. Very truly I tell you, no servant is greater than his master, nor is a messenger greater than the one who sent him. Now that you know these things, you will be blessed if you do them."
Works well for me, anyways. It's satisfying to live at peace with self and with others!
God bless!