Output only the basename of source files to be independent of the build
system source paths.
In the future it may be better to use the GCC -fmacro-prefix-map option.
This option is available in GCC 8 and later. It is not yet available in
clang.
Update #3818.
This ensures that lines are output atomically if they are produced by
different other contexts, e.g. interrupts, other processors, other
threads.
Update #3199.