Pass around C pointers as Java long

so we're 64bit-ready
Keep a reference count on the native objects

When creating a snapshot or an iterator, increase the reference count of
the database or snapshot it's based on. Close the native resource
when it's refcount reaches 0, rather than explicitely closing the
wrapper.
Add a non-static destroy method

which will destroy a database instance once it's closed.
Add a warning if resources are leaked.

Print a warning if a NativeObject is finalized before its native
resource is closed
Add missing static statement
Add additional checks in unref()

make sure no code calls unref() more than it should. Requires taking a
wider lock, but this isn't performance critical code anyway
Add a dependency on android in the maven build

because we now use android.util.Log
Fix tests
Merge pull request #9 from jobi/refcount

Keep a reference count on the native objects