move problematic darwin specific import inside darwin if/else branch

This import fails for me on Linux, moving it in the if/else makes it build under Linux again at least.