Window state preservation for node-webkit