Static code analysis cleanups and minor bug fixes

- Fix for initializing all the un-initialized variables
- Handling system call failure like socket,fcntl etc...
- In btpan_tap_close validate tap_if_down and close the socket.
- Invalid memset size, which could have potential memory issue
- Change -1 to INVALID_FD where appropriate

Bug: 19417758
Change-Id: Id31832f8678b2d72c80740c29b946a94e7ae0197
15 files changed