nrf51822/log: Refactor buffer manipulation

Now the buffer can accomodate several messages. Then log_print()
doesn't write directly in the buffer. It first formats the message in
a temporary buffer and, with the final length, copy the formatted
message to the output buffer.

This means that log_print() slower than before, but the atomic
logging functions (in the next commits) will be very fast.
log: Implement several logging functions
examples/logging: Update example to use new functions
log: Change log_print() API to log_printf()