Determine processor count on OS X with sysctl()

The previously used MPProcessorsScheduled() is deprecated as of Mac
OS X 10.7.

See also Qt's fix at https://qt.gitorious.org/qt/qtbase/commit/a891ef6
Added missing include for PATH_MAX on OS X
Added subdir-objects option for automake
Don't use -rdynamic for gcc on Mac OS X

This is the default behaviour on Darwin and is an invalid option.
Renamed INCLUDES to AM_CPPFLAGS in Makefile.am

The former is deprecated
Make global includes in lunar.h explicit
Fixed potential deadlock in Thread::start()
Removed extra newline
Fixed cleanup order in Gnuplot destructor
Added return code checks for pthread function calls
Use existing abstractions for the Semaphore implementation
Use a wait condition for joining threads

This seems to be more reliable than pthread_join(), which did not play
well with the thread cleanup on Mac OS X. This was reported as a crash
in <http://sourceforge.net/p/scm-pepper/bugs/7/>.

The new implementation is inspired by Qt's thread implementation for
unix. Thread::wait() waits for a wait condition and will be woken up
from within the cleanup function.
Added first unit tests for sys::parallel
Fixed PopenStreambuf for small reads

The previous implementation assumed that at least m_putback bytes
would be available from the input pipe.
Updated copyright notices

Happy new year!
Enabled backtraces on OS X
Include error code in errno-based exceptions