src/flash: remove 'extern' and wrap headers