logd: move stripping of newlines to log_add()