wifi: ignore SIGPIPE when dumping stats to dumpstate

If dumpstate closes the reading end of the pipe (likely due to timeout)
and wifi vendor hal attempts to write to the fd it received from
dumpstate, it will receive sig 13 (SIGPIPE), and is then killed.
We should protect wifi vendor hal from the abnormally behaved clients.

Sync patch from ag/12321138. Reference from b/172972545 &
b/161336019#comment29

Bug: 161336019
Bug: 172972545
Test: Manuel Test, Wifi works normally
Change-Id: Ie7de040ac4320f83500c18e74e3c58d63b4df1b7
diff --git a/wifi/1.5/default/service.cpp b/wifi/1.5/default/service.cpp
index 8539a37..23e2b47 100644
--- a/wifi/1.5/default/service.cpp
+++ b/wifi/1.5/default/service.cpp
@@ -17,6 +17,7 @@
 #include <android-base/logging.h>
 #include <hidl/HidlLazyUtils.h>
 #include <hidl/HidlTransportSupport.h>
+#include <signal.h>
 #include <utils/Looper.h>
 #include <utils/StrongPointer.h>
 
@@ -45,6 +46,7 @@
 #endif
 
 int main(int /*argc*/, char** argv) {
+    signal(SIGPIPE, SIG_IGN);
     android::base::InitLogging(
         argv, android::base::LogdLogger(android::base::SYSTEM));
     LOG(INFO) << "Wifi Hal is booting up...";