fix redeclaration of function wait in db.c

wait is already declared as pid_t (int*) in <sys/wait.h>.
Also, there's no need of external linkage for that variable.
fix compilation on systems that have strlcpy
improve availability test for get_current_dir_name

It's hard to enumerate all systems that don't have get_current_dir_name
(basically everything except Gnulib)
Merge branch 'feature/osx_compat' into develop