Boundary effects of weak nonlocality in multilayered dielectric metamaterials