Fix possible increment of tracked notification count when message has exceeded max attempts
Fixes #331