title: How to release resources from processes killed by grunt-contrib-watch?
body: <p>I'm trying to use the module <code>grunt-contrib-watch</code> to restart my node.js server whenever certain files change. I already use grunt to run the server, jshint, and the template compiler, and I know those functions work. Here's the task to start the server:</p>
  
  <pre><code>grunt.registerTask('runServer', 'Starts the server.', function(){
       grunt.log.writeln('Starting server...');
       var done = this.async();
       var child = grunt.util.spawn({
           cmd: process.argv[0],
           args: ['server.js'],
       }, function(){
           grunt.log.writeln('Server stopped!');
           done(true);
       });
       child.stdout.pipe(process.stdout);
       child.stderr.pipe(process.stderr);
   });
  </code></pre>
  
  <p>Here's the config for the watch task:</p>
  
  <pre><code>watch: {
      all: {
          files: ['some/files/*.js'],
          tasks: ['default'],
          options: {
              spawn: true,
              interrupt: true,
              reload: true,
          }
      }
  }
  </code></pre>
  
  <p>When the task is restarted, the server fails because of an "EADDRINUSE" exception, which I take to mean is because the previous child process didn't release the port it was using, which is strange - I do see the "Server stopped!" message. I have tried this with all combinations of the three options, and I looked on the github page for grunt-contrib-watch, and nothing showed anything. How can I make the interrupted node.js process close all its resources before the next one tries to start?</p>