Self-similar shedding of vortex rings