Fix build failures on platforms with a lib named aio
Fix build failures on platforms with a lib named aio

Solaris have a library named libaio.so, which historically
provided the asynchronous IO functions aiocancel/read etc,
but all of this is now part of libc (and the library exists
for backwards compatibility). We need to check that we've
got the header and the library before using the macro,
otherwise we'll get errors due to using a cmake variable
that isn't set

Change-Id: Ie87790fc527c7877d01cd8aef7bd7c8a17f5a117

couchbase/forestdb,couchbase/forestdb,zhaog/forestdb,wurikiji/forestdb,wurikiji/forestdb,joliss/forestdb,jinxuan/forestdb,joliss/forestdb,zhaog/forestdb,jinxuan/forestdb,sushmaad/forestdb,sushmaad/forestdb,yyangpan/forestdb,yyangpan/forestdb,hisundar/forestdb,hisundar/forestdb