build: handle some weirdness in __sun systems.
mock-server: block using mutex/cond for startup.