Japan will end law that restricted women from marrying after divorce