gobject: use more portable approach for compute the class slots