Prime Minister Sanae Takaichi made an offering to a shrine seen by Japan’s neighbors as glorifying its wartime past, in a move that stops short of a visit but may still anger China and other neighboring nations.