Initial commit of OS X support

Use libproc to list PIDs of running processes and retrieve
the current working dir for each
Fix race in reading from event sources

Fix conflicting read/update on 'sources' var in loop