JniBasedUnixGroupsMapping has some issues.
- sometimes on error paths variables are freed prior to being initialized
- re-allocate buffers less frequently (can reuse the same buffer for multiple calls to getgrnam)
- allow non-reentrant functions to be used, to work around client bugs
- don't throw IOException from JNI functions if the JNI functions do not declare this checked exception.
- don't bail out if only one group name among all the ones associated with a user can't be looked up.