Update app.js to avoid Windows crash

process.getgid() results in app.js crashing on win32 systems, as that function isn't available. This checks the OS platform before calling process.getgid() to avoid this crash happening.