title: Chrome extensions pageAction.setIcon unreliable
body: <p>I'm trying to toggle an icon of my pageAction. This is the code I'm using:</p>
  
  <pre><code>var activated = new Boolean();
  
  chrome.pageAction.onClicked.addListener(function(tab) { 
   if(!activated){
          chrome.pageAction.setIcon({tabId: tab.id, path: 'icons/expanded.png'});
          activated = true;
          alert("activated");
      }else{
          chrome.pageAction.setIcon({tabId: tab.id, path: 'icons/expand.png'});
          activated = false;
          alert("not activated");
      }
  });
  </code></pre>
  
  <p>Though this works most of the time, sometimes it reports the changed state but doesn't toggle the icon. 
  Does anybody know why this is happening?</p>