Correct handling of restart signals in messenger.py