during initialization, do not set a callback if log_pid == 0

The callbacks in Log::Dispatch are a hot path as they are called on
every log. This is an optimisation of the callbacks set by Dispatchouli
to not check if log_pid is set on every call.

The Log::Dispatchouli construction is modified to set optimized
callbacks:

* if log_pid == 0, do not set a callback
* if log_pid == 1, set a optimized callback that just adds the "[$$] "
  prefix, without condition.
to_file: improve build of log_file default value

- Fix a possible race condition
- Fix multiples wrapped sprintf calls
to_file init: simpler callback when file_format is unset

The callback for Log::Dispatch::File is now simplified (just one sub
instead of a sub wrapped with a sub) when file_format is not set. This
improves speed.
v2.011

          some optimizations in timestamp and pid logging (thanks, Olivier
          Mengué)