Exercise 3: Added clearing lock. Removes writer pid and writer count = 0. For readers, decrements reader lock count and removes current pid from list of reader pids.