scripts/dts: Move flash partition handling out of property loop
scripts/dts: Move flash partition handling out of property loop

Due to the way the code was structured,
flash.extract_partition(node_path) was called multiple times for the
same 'node_path'.

That must've been a mistake to begin with (but was hard to spot before
the code was cleaned up). Move the generation of per-node #defines out
of the property loop.

Signed-off-by: Ulf Magnusson <01743f1c1deb1fe75271d62edb65757d98ac0bcb@nordicsemi.no>

galak/zephyr,nashif/zephyr,ldts/zephyr,nashif/zephyr,nashif/zephyr,Vudentz/zephyr,Vudentz/zephyr,Vudentz/zephyr,finikorg/zephyr,galak/zephyr,GiulianoFranchetto/zephyr,ldts/zephyr,galak/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,finikorg/zephyr,finikorg/zephyr,galak/zephyr,ldts/zephyr,ldts/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,Vudentz/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr