Make LD_DEBUG logging go to stderr as well as logcat.

This matches glibc, and is a lot more convenient. Although in general
bionic tries to send diagnostics to both, I'm not entirely convinced
that sending this to logcat makes any sense; it's too verbose to be
useful there, and it takes so long that there's bound to be other output
interleaved. But "do what we do elsewhere" fixes my immediate usability
problem, and adding behavior seems less contentious than changing
behavior.

Change-Id: I5d6c17b5c35a75c19a890cb357984c729b1a4b52
diff --git a/linker/linker_debug.cpp b/linker/linker_debug.cpp
index b0aae79..e6211f7 100644
--- a/linker/linker_debug.cpp
+++ b/linker/linker_debug.cpp
@@ -30,13 +30,14 @@
 
 #include <unistd.h>
 
-void linker_log_va_list(int prio __unused, const char* fmt, va_list ap) {
-#if LINKER_DEBUG_TO_LOG
-  async_safe_format_log_va_list(5 - prio, "linker", fmt, ap);
-#else
-  async_safe_format_fd_va_list(STDOUT_FILENO, fmt, ap);
-  write(STDOUT_FILENO, "\n", 1);
-#endif
+void linker_log_va_list(int prio, const char* fmt, va_list ap) {
+  va_list ap2;
+  va_copy(ap2, ap);
+  async_safe_format_log_va_list(5 - prio, "linker", fmt, ap2);
+  va_end(ap2);
+
+  async_safe_format_fd_va_list(STDERR_FILENO, fmt, ap);
+  write(STDERR_FILENO, "\n", 1);
 }
 
 void linker_log(int prio, const char* fmt, ...) {