[ruby] free memory used by gmp structures