How to prevent accidental unclipping while cornering?
Don't worry about things that haven't happened. 

Most people new to clipless are worried about the exact opposite. "Will I be able to unclip if things go south in a turn?" 

Eventually you will get to the point where clipping in/out is completely unconscious. 

Having said all that, if unclipping when you don't want to really becomes a problem, look into getting a setup with more "float". Float is the angle at which the cleat releases. 
SPD cleats come in different versions with different float. 

You can also get pedal with more float that standard SPD's.