Check that mentioned post by @JasonWalker but specifically the section 9.5.2 problem with detecting restart? and look at the registry items there as that is what controls the pending restarts.
Check that mentioned post by @JasonWalker but specifically the section 9.5.2 problem with detecting restart? and look at the registry items there as that is what controls the pending restarts.