A Distributed Safety Mechanism using Middleware and Hypervisors for Autonomous Vehicles