Polyharmonic Green functions and nonlocal Bondi-Metzner-Sachs transformations of a free scalar field