South Korea court upholds ban on gay sex in the military