Use atomic int for notification count

Change-Id: Icf0bbd05a0115b3532320c0a43f1f4fd21f04f86