South Korea shelves disputed military pact with Japan