The logic, surprisingly, is quite the opposite. "Bezpieczny" = "safe" comes from quite an old-fashioned, if not archaic, phrase "bez pieczy" - more or less, 'without care' ('piecza' doesn't even have a Polish wiktionary entry). The logic then was that sth is 'without care', because nothing endangers it, it doesn't need care, ergo - because it is safe. And that's how 'bezpieczny' was created, and from it - niebezpieczny, as its negation.
I do not think there was ever a word "pieczny". But sjp.pwn.pl http://sjp.pwn.pl/szukaj/bezpieczny.html says that bezpieczny is from "bez pieczy" piecza=opieka without protection/care, as in does not need protection.
so it is not needing protection=safe=bezpieczny
The Polish word (nie)bezpieczny is a bit tricky, semantically.
1) Ten mężczyzna jest niebezpieczny. - He's dangerous (stay away from him!)
2) Ten mężczyzna nie jest bezpieczny. - He isn't safe (he's not in a safe place).
While the second sentence might also be understood as 'he's dangerous', the first one only has this one meaning.
And I don't believe that the English word 'unsafe' works as a synonym of 'dangerous' when used with people.
The iweb corpus shows 54 results for 'man is dangerous', but 0 for 'man is unsafe'. One of our native speakers suggests, that if the phrase 'this man is unsafe' means anything, then it's meaning 2) which however isn't covered by this Polish sentence.