Declare _WITH_GETLINE as gcc was complaining on FreeBSD
Refactored the code to use a reading thread and kevents to detect file changes