Fix build errors on windows

Author: Chaobin Zhang
renderer needs to exit gracefully

Fix rogerwang/node-webkit#408 after rebase