A bear that ran amok in a supermarket in northern Japan has been caught two days after it attacked a worker, the latest in a surge of encounters between bears and people in the country.