So, if somebody sues you, can they actually win the process? If so, how would I have to modify the license so there are no legal consequences for me when licensing my project?
Patent laws vary between countries, but a general feature is that one can only patent their own original inventions. If somebody else knew the details of the invention before the patent was applied for (prior art), the patent is not valid.
So if somebody else tried to get a patent on your invention, you (or anyone else) could simply provide the patent office with evidence of prior art. This would be particularly easy to do if you had already released the invention to the public, since potentially anyone could testify that they knew about the invention. Their application would then be rejected.
If they were awarded the patent without anybody noticing, and then tried to sue you (or some third party) for infringement, you could likewise produce the prior art, and their patent would be declared invalid and their lawsuit dismissed.