curlbasesink: small code cleanup

Use a local var and save a local var.
curlbasesink: strip newlines from curl debug messages

The messages we receive in the custom log handler might end with a newline and
are not \0 terminated. Copy the messages, trim and terminate them.