I had OCD myself when I was younger, although never diagnosed,I know it was ocd. I would close doors a certain number of times, make sure I prayed etc. I realised once you start breaking some of your rules, perhaps closing the door 3 times instead of 4. Or not closing it at all, you realise NOTHING bad will happen to anyone, it's just irrational fear and there is no need to worry.
I am completely free of OCD now, not a single trace left so don't worry you will overcome it, I overcame it all by myself in time, put your mind in focus on other things. It will all be okay, I promise, If I can completely get over it so can you!