What is a watchdog timer, and how do you implement it to ensure system reliability in an RTOS environment?