build+tests: Fixing compilation of unit tests

This commit makes sure that OSX-related tests are enabled only on Darwin
platform.

Change-Id: I997187ee2905e788ac9ae4e777156ed73771053e