Code:
CLKPR = (1<<CLKPCE);
CLKPR = B00001000
CLKPR = B00001000
first in the setup part of code to see how it affects power consumption. The effect is the microcontroller becomes 256 times slower and could not be programmed anymore. The solution is to use the -i switch on Avrdude. This slows down the programmer and programming is now possible
This did the trick for me using a parallel programmer:
avrdude -c dapa -p m328p -i 40 -e
avrdude -c dapa -p m328p -i 40 -U flash:w:blink.hex