Earnest money demonstrates your commitment to a purchase — but it can be at risk if you are not careful. Here is how it works, how much to offer, and how to protect it.