TS-2504: replace OpenSSL detection with AX_CHECK_OPENSSL

Use the ax_check_openssl.m4 macro from the autoconf archive so that
we don't need to carry around custom OpenSSL detection logic.
TS-2504: detect OpenSSL library in 64 bit library paths
TS-2504: fix bad OpenSSL lib64 detection patch merge
TS-2305: fall back to ftruncate on posix_fallocate failure