Update car.c

Implement locking using reader writer semaphore