Fix threading tests when threads disabled
Fix refcount issues with mutex protected ignores

Some ignore files were not being freed from the cache.
Fix leak when using push and pop with ignores

The iterator pushes and pops ignores incrementally onto a list as
it traverses the directory structure so that it doesn't have to
constantly recheck which ignore files apply.  With the new ref
counting, it wasn't decrementing the refcount on the ignores that
it removed from the vector.
Fix leak in git_index_conflict_cleanup

I introduced a leak into conflict cleanup by removing items from
inside the git_vector_remove_matching call.  This simplifies the
code to just use one common way for the two conflict cleanup APIs.

When an index has an active snapshot, removing an item can cause
an error (inserting into the deferred deletion vector), so I made
the git_index_conflict_cleanup API return an error code.  I felt
like this wasn't so bad since it is just like the other APIs.

I fixed up a couple of comments while I was changing the header.
Minor tree cache speedups

While I was looking at the conflict cleanup code, I looked over at
the tree cache code, since we clear the tree cache for each entry
that gets removed and there is some redundancy there.  I made some
small tweaks to avoid extra calls to strchr and strlen in a few
circumstances.