Fix PlatformRunOnce portability

pthread_once_t is an opaque data type which we can't make any
assumptions about, and similarly PTHREAD_ONCE_INIT is an opaque value.
On OS X for example, it happens to be defined as a struct. Thus we can't
simply use int in place of it.

This commit changes the instances where int was used to store a one-time
initialisation variable to use DF_ONCE_DECL, and always initialises it
with DF_ONCE_INIT. The code now builds on all platforms, regardless of
what these two things are defined as.