Rename public interface methods to avoid two overloaded methods with the same name

This is required to make the order in the C++ virtual table
consistent in MSVC - previously the overloaded methods were
ordered differently in the vtable compared to the interface
declaration.
Add a public C API to the library

Add a struct that matches the C++ interface vtable.

This requires that the C++ interface methods are declared to use
the same calling convention as normal C functions, and that the
C struct exactly matches the layout and ordering of the C++
virtual table - MSVC seemed to reorder methods if there were
overloaded methods.
Use sched_getaffinity to get the number of cores on linux

This gets rid of the code that parses /proc/cpuinfo, and avoids
forking within the library.

The previous code also failed build on modern glibc versions
due to ignoring the return value of the system, read and write
system calls.
Use sysctl instead of the deprecated Gestalt API for getting the number of cores on OS X

Also use the __APPLE__ predefined define instead of MACOS for enabling
these code paths.

This also avoids having to link to the CoreServices framework in
order to get the Gestalt function.
Merge pull request #181 from mstorsjo/threadlib-update-macos-linux

Update the cpu core count detection functions for linux and mac os
Merge pull request #184 from mstorsjo/c-interface-vtbl

Add a public C API to the library by mimicking the C++ ABI with a C struct
Merge remote-tracking branch 'upstream/master' into travis.osx