A rate lock protects you from rising rates between application and closing. Here is how rate locks work, how long to lock, and what happens if your closing is delayed.