Removing unneeded code duplication in ls-remote.c
Adding credentials callback to ls-remote and fetch too.
Build all example files if BUILD_EXAMPLES used.
Merge pull request #1822 from kadamski/examples-cleanup

Small cleanup in examples.