A "written death threat" is not "illegal". I've seen plenty of such threats written on the boundaries of military sites or even electricity substations. Delivering death threats to a person may constitute illegal harassment, but so might delivering love letters. It all depends on the circumstances.