Macbook(white) Unibody 2009 won't turn off

Just wondering if someone has had the same problem or know what it could be.

My wife has a Unibody Macbook(white) from 2009 that will not turn off. Well, actually it turns off but it always restarts automatically.

I found a few people with the problem on the internet but no solution so far.

Some things I have already tried:

-I've made a clean install of the OS.

-Restored permissions

-Disconnected the battery

-Forced the shut down holding the power button. In this case it does turns it off but does not solve the problem.

The Macbook is working perfectly so I believe it is not a hardware problem but I can not find a way to sort this problem.

If anyone knows what could it be please let me know.

Thanks a lot!

P.S - Latest version of Mavericks. No updates to be done. Issue started about a year ago.