Register kqueue events only once at the watch (re)initialization

Do not reload whole set of kqueue watches on every event
Garbage collect old kqueue changelist management code
Autodetect pthread_barrier functions presence at configure stage
Use supplied ones if no system pthread_barrier functions was found
Rename source files: barriers.* to compat.*
Rename internal barrier implementation to pthread_barrier_*
and attach it to build only in absence of pthread barriers
Create worker_remove_watch

Create a simplified version of worker_remove_many intended for deleting only
one watch per call
Use worker_remove_watch

Greatly simplify handle_overwritten and handle_replaced through using
worker_remove_watch and some other already existing code.
Remove now unused watch_reopen
Create helper macroses EVENT_WRITE and EVENT_WRITE_BULK
And use it instead safe_write and bulk_write
Replace homegrown linked list implementation with queue(3) macroses.

While here combine filename and inode number into common structure named
dep_item to reduce memory required for shallow list copy

Structures introduced in this commit have following meaning:
 * dep-list - dependency list head
 * dep-node - linked list node refering to next node and item itself (file)
 * dep-item - dependency list item payload
Replace path and inode arguments with dep_item
all over dependency list diffing routines
Change dl_listing to take other dependency list as argument, not path
Remove all unchanged entries before other list processing

Remove all unchanged entries (with identical inode numbers and filenames) from
traversed lists before other list processing so all consequent scans will be
performed on smaller set of entries. Add callback hook named handle_unchanged
for this event (NOP for now)
Change handle_replaced semantic

Change handle_replaced semantic so it no more produces IN_MOVED_FROM /
IN_MOVED_TO notifications pairs as it will be handled on handle_moved callback.
This allow us to skip dl_diff and creation of one of temporary dep_lists
Empty before_list on processing

Release memory allocated for before_list items while diff traversing not
after. This allow us to skip creation of another one temporary dep_list.
While here handle dl_shallow_copy failures