Magic hit key free throws to escape with double OT win in Miami