A restraining order would help, and I advise you to get one which will at least let him know that he and his behaviour are being watched. Your part will be to have no contact whatsoever with him, he can communicate through your lawyer if need be.
Yes, there are no safety guarantees, so maybe change your locks, get a security alarm, and do everything you can to protect yourself.
I always take threats seriously, no matter what the context of how they are issued.
Hugs