Optional TCP_KEEPIDLE in unit tests

Allows to run unit tests on BSD-based platforms. The commit
da99c339 that solved the problem doesn't contain fixes of unit
tests.

Change-Id: Iff1771c1cbb37c30a888cd1da4fca5636e5797e7
Merge "Optional TCP_KEEPIDLE in unit tests"