bug 976960

* fire cardviewclosed with new stack position but wait for 'appopen' from AppWindowManager to fire before actually hiding the cardswitcher.
* added unit test to ensure that we don't regress this fix.

r=etienne