global: free the error message when exiting a thread

When we free the global state at thread termination, we must also free
the error message in order not to leak the string once per thread.
Correctly handle getaddrinfo return result

The getaddrinfo function indicates failure with a non-zero return code,
but this code is not necessarily negative. On platforms like Android
where the code is positive, a failed call causes libgit2 to segfault.
Introduce GIT_ALIGN
Ensure pool data is aligned on an 8 byte boundary
The raw index buffer content is not guaranteed to be aligned

* Ensure alignment by copying the content into a structure on the stack
Fixed merge REUC test for big-endian 64-bit
Fixed odb foreach test failure for big-endian 64-bit
Silence uninitialized warning
Ensure patch is initialized to zero, otherwise, the allocated flag may be set
Silence unused return value warning
Merge pull request #2559 from libgit2/cmn/free-tls-error

global: free the error message when exiting a thread
Merge pull request #2582 from swansontec/master

Correctly handle getaddrinfo return result
Merge pull request #2584 from jacquesg/pool-alignment

Pool/Index data is not aligned