Scotland showed their defensive qualities to prevent Japan from scoring after several phases of play within touching distance of the try-line.