Control of the radiative level shift and linewidth of a superconducting artificial atom through a variable boundary condition