HAL_AVR: renamed pins_arduino_mega.c to .cpp

this fixes a compiler hang on at least one Ubuntu platform. May be a
problem building empty C files?

It also makes our build more consistent
HAL_FLYMAPLE: rename flash_stm32.c to .cpp

this avoids a compiler hang on Ubuntu when not building for flymaple