Do not drag the icon to the trash can. Just drag it off the dock - and drop it. Then it will go away.