Fix tests for JRuby.
Fix tests for JRuby.

The fields method of JRuby's FFI::StructLayout returns each field twice. Work
around this by using different methods to get the same information.
mvz/gir_ffi,mvz/gir_ffi,mvz/gir_ffi,jcupitt/gir_ffi,jcupitt/gir_ffi