As in anywhere else in Morocco safety is not a problem in Essaouira. Violent crimes are almost non existent. But as always while traveling, you do have to be careful with pickpockets. Crowded places are the most dangerous.
There is an open debate whether women should travel alone in Morocco. My experience says that there is no problem with that. If you are a woman and want to travel alone, you have to know that from time to time you may be harassed, but you will always be safe. If you are a woman in Morocco you can be sure about one thing, nowhere else will so many men look at you.