I have actually experienced this feeling, so I can relate.
When I was a kid, I started confessing to my mom when I thought about curse words or had any mean thoughts about other people. Now think about that for a second ... when you're a kid and you try not to ever think about "bad" words or "mean" thoughts, those are probably the only things you'll be able to think about. Then, after those words or thoughts would occur to me, I'd feel a need to confess.
Trust me on this one: Stop confessing! They're just thoughts. You aren't doing anything wrong, and it really is impossible to stop thoughts from popping into your head. From my own experience, I think this is just an obsessive tendency. And you'll never be able to "confess" enough to satisfy the obsession. You'll come up with more things to confess, and it will be just a temporary relief until you start to feel guilty again.
Another way to think of it? You're probably doing your girlfriend a favor by not confessing things like the one you mentioned. You could make her worry or feel insecure for no reason. Save any confessions (or apologies) for a time when you've actually done something wrong