Fix public header on sys/refs.h

GIT_BEGIN/END_DECL were missing from sys/refs.h and preventing
compilation with g++ as the symbol were mangled.
Merge pull request #2768 from dprofeta/fix/c++-refs

Fix public header on sys/refs.h