Add unit tests for SocketDrainer class.

Provide unit tests to exercise the interfaces (both C and C++)
and make sure the SocketDrainer drains socket before closing it.

Change-Id: I36f7e31181b89337c747cb07ab6605341aae90fc
Merge "Add unit tests for SocketDrainer class."