APP single instance test case PR for v0.8

Same PR as [APP single instance test case PR for v0.9](https://github.com/rogerwang/node-webkit/pull/1948).
Please merge it into branch nw0.8.