sleep mode and pin states

Sorry for the late answer, but I only figured out yesterday what was the problem.
It was the freaking wind! I had my project on my terrace, which is a pretty windy place. I thought the MCU was resetting because of power fluctuations, but it was the wind wobbling the setup and causing the PIR sensor to be constantly active.
When you hear hoof beats, think of horses, not zebras...
Also, always test your projects indoors first!