A characterization theorem for stable random measures