Removed non-reentrant code from signal handler in controller and router daemons.