move common get_elements code to ompi/datatype/ompi_datatype_get_elements.c