Add test to ensure CDTDatastore filehandles aren't leaked (#429)
Add test to ensure CDTDatastore filehandles aren't leaked (#429)

* Add test testDatastoreClosesFilehandles

This test ensures that we don't excessively leak filehandles, which is an indication that the
CDTDatastore and CDTQIndexManager objects are not being dealloc'd correctly

* Free malloc'd memory

* Fix comments, copyright, and exit early if we fail

* Only compile testDatastoreClosesFilehandles on macOS

cloudant/CDTDatastore,cloudant/CDTDatastore,cloudant/CDTDatastore,cloudant/CDTDatastore