Applying Over-the-Air Updates Safely in Automotive ECUs