Electromagnetic-field fluctuations near a dielectric-vacuum boundary and surface divergences in the ideal conductor limit