remote: fix rename docs
treebuilder: insert sorted

By inserting in the right position, we can keep the vector sorted,
making entry insertion almost twice as fast.
pathspec: use C guards in header
Merge pull request #2416 from libgit2/cmn/treebuilder-insert-sorted

treebuilder: insert sorted
revwalk: more sensible array handling

Instead of using a sentinel empty value to detect the last commit, let's
check for when we get a NULL from popping the stack, which lets us know
when we're done.

The current code causes us to read uninitialized data, although only on
RHEL/CentOS 6 in release mode. This is a readability win overall.
Merge pull request #2417 from libgit2/cmn/revwalk-array-fix

revwalk: more sensible array handling
netops: init OpenSSL once under lock

The OpenSSL init functions are not reentrant, which means that running
multiple fetches in parallel can cause us to crash.

Use a mutex to init OpenSSL, and since we're adding this extra checks,
init it only once.
remote: update documentation

Add docs for git_clone_local_t and move the docs for the
git_clone_options to each field.
ssl: use locking

When using in a multithreaded context, OpenSSL needs to lock, and leaves
it up to application to provide said locks.

We were not doing this, and it's just luck that's kept us from crashing
up to now.
ssl: cargo-cult thread safety

OpenSSL's tests init everything in the main thread, so let's do that.
ssl: init also without threads
ssl: init everything all the time

Bring together all of the OpenSSL initialization to
git_threads_init() so it's together and doesn't need locks.

Moving it here also gives us libssh2 thread safety (when built against
openssl).
http: fix typo in credentials logic

We want to check whether the credentials callback is NULL, not whether
the payload is.
test: use read-only account

Don't write in plaintext the password of an account which has full
control over the repository. Instead use an account with read-only
access.
test: remove assembla clone test

The assembla failure we were seeing referred to a private repository,
which is not what is there at the moment.

This reverts 1fd21b0342f
Merge pull request #2421 from libgit2/cmn/init-ssl-once

netops: init OpenSSL once under lock
Merge pull request #2425 from libgit2/cmn/clone-auth-change

Don't use read-write accounts for the tests