Fix OSX and FreeBSD build, broken by feature/premature-stopping branch.
Fix OSX and FreeBSD build, broken by feature/premature-stopping branch.

Address issue #3926.

shogun-toolbox/shogun,sorig/shogun,karlnapf/shogun,lisitsyn/shogun,lambday/shogun,shogun-toolbox/shogun,besser82/shogun,sorig/shogun,geektoni/shogun,besser82/shogun,lisitsyn/shogun,sorig/shogun,karlnapf/shogun,lisitsyn/shogun,shogun-toolbox/shogun,besser82/shogun,karlnapf/shogun,geektoni/shogun,lisitsyn/shogun,shogun-toolbox/shogun,geektoni/shogun,shogun-toolbox/shogun,lisitsyn/shogun,lambday/shogun,besser82/shogun,lambday/shogun,geektoni/shogun,karlnapf/shogun,geektoni/shogun,besser82/shogun,karlnapf/shogun,lambday/shogun,geektoni/shogun,sorig/shogun,karlnapf/shogun,lambday/shogun,sorig/shogun,sorig/shogun,shogun-toolbox/shogun,lisitsyn/shogun,besser82/shogun,lambday/shogun