Mitsubishi posts gains in quarterly, first-half profits