Make lwan compilable on Ubuntu 12.04

* Modify the library order to as to ensure that pthread-related
`undefined reference`s are all accounted for. Similarly, move
zlib references to the end. This was an issue for both `lwan`
and `freegeoip` binaries, so fix only those.

* `sqlite3_errstr` remains undefined even after rearranging the
order of library linking. This could be an issue with v3.8.3, but
I am not completely sure. Modifying it to `sqlite3_errmsg` works.
hash.c: Fix integer conversion warnings
list.c: Fix integer conversion warnings
int-to-str.c: Fix integer conversion warnings
lwan.c: Fix integer conversion warnings
lwan-config.c: Fix integer conversion warnings
lwan-io-wrappers.c: Fix integer conversion warnings
Fix warning for duplicate declaration of `index`

Rename the variable hat identifies values within the sql query with
placeholders to `ind` from `index`. This fixes the following warning:

/home/vaibhav/lwan/freegeoip/freegeoip.c: In function
‘text_column_helper’:
/home/vaibhav/lwan/freegeoip/freegeoip.c:232:44: warning: declaration of
‘index’ shadows a global declaration [-Wshadow]
lwan-request.c: Fix integer conversion warnings
lwan-response.c: Fix integer conversion warnings
lwan-serve-files.c: Fix integer conversion warnings
lwan-status.c: Fix integer conversion warnings
lwan-template.c: Fix integer conversion warnings
lwan-thread.c: Fix integer conversion warnings
lwan-trie: Fix integer conversion warnings
realpathat.c: Fix integer conversion warnings
strbuf.c: Fix integer conversion warnings
base64.c: Fix integer conversion warnings
main.c: Fix integer conversion warnings
lwan-io-wrappers.c, lwan-socket.c: Fix integer conversion warnings