Linux compatibility updates

Hi, Hannes,

Here's the highlighting stuff we worked on yesterday -- and, as an added (and highly experimental) bonus commit, Filip and I have also tried to get rid of the busy-waits.

Cheers
Alec