The points many people in this thread have raised about other nations already preparing their own expedition, and the great likekyhood of Japan being pried open anyway, are very valid. However... the OP wants a Japan that is not opened, which demands a POD that prevents all Western powers from trying to open Japan.
Such a POD would be hard to reach, but I imagine a stalemate in the Great Game, combined with a USA that doesn't reach the Pacific (or reaches it much later, or has less interest in Pacific trade for other reasons) could conceivably do the trick.
As others have already pointed out, the actual situation in Japan was far more complex than it is often made out to be in Western history books (excepting history books that are specifically about Japan or Asia in general). In the absence of a power forcibly opening Japan, there would still be tensions within the country.
Let's look at OTL. Heavily simplifying matters, one might say that the Tokugawa shogunate has already realized that Western powers were a threat, and attempted to adept to it. Critics of the Tokugawa shogunate were typically traditionalists, who felt (even before Perry's expedition) that Japan was catering to foreign powers too much. The doctrine of Sonnō jōi (Revere the Emperor, expel the barbarians) may have crystalized after Perry's expedition, but the fundaments were there long before.
The Emperor became the focal point of the new vision, which sought to end the 'weak' shogunate and create a strong Japan under an Emperor who was not only a figurehead, but actually reigned. In the initial phases, the advocates of this view were die-hard traditionalists, who went so far as to assasinate prominent scholars of 'Western learning'.
Only later did the doctrine of 'Western knowledge, Eastern morality' arise, which meant that Japan sjould use Western science, methods, technology etc. while retaining its own moral and cultural distinctiveness.
At that point, the traditionalists fought against the modernizers, and (predicably) lost. But both sides proclaimed loyalty to the Emperor. No-one was fighting for the shogunate at that point.
Now, given an ATL wherein no Western power forces the opening of Japan, a coalition of traditionalists, merchants, disaffected warriors etc. will still arise... and it will likely still focus on the Emperor. Difference is: Western influece will not be a fait accompli, and the traditionalists will win. Modernizers and 'Western' thinkers will be associated with the old, weak regime... and Japan will (in the short term) become more closed off, and will reject all things 'Western' with great vehemence.