Fix warnings in thread-utils.h when building without -DTHREADSAFE=ON

The compiler was generating a bunch of warnings for
git_mutex_init and git_mutex_lock when GIT_THREADS
was not defined (i.e. when not using -DTHREADSAFE=ON).

Also remove an unused variable from tests/path/core.c.
Merge pull request #2556 from sbc100/fix_warnings

Fix warnings in thread-utils.h when building without -DTHREADSAFE=ON