Japanese towns have deployed a robot wolf with flashing lights to scare away bears that have become a problem in the countryside.