Fixes STM32 examples to compile with link-time optimizations.

When newlib is compiled without LTO, the linker wrongly discards
functions provided by user code but unreferenced from LTO compiled
code.

Thus, we need to mark with attribute((used)) functions that should be
called from the library.