If this is truly a concern of yours, I would suggest not marrying.
Correct. This is such a terrible thing. I'm coming up on 6th year of living with my girlfriend and I am told that California is also something like this... i.e. if you are living together for 7 or more years (maybe 10, not sure) that it's as if you are married. Terrible!
http://www.npr.org/2016/09/04/487825901/no-you-re-not-in-a-c...
Australia and Canada have common-law relationships that aren't marriage but do involve dividing property in courts.