title: sqlite3 db.close() called before db.serialized() finishes
body: <p>i have a sqlite3 nested query case. Was hoping to push each query result to a json array and return it back.
  But always get "Error: SQLITE_MISUSE: Database handle is closed" for the 2nd select call.
  Seems the db.close() gets called before the 2nd query.</p>
  
  <p>Why is this, i thought serialize can take care of this. How to fix it please ?</p>
  
  <pre><code>var getMyDbInfo = function(callback) {
      var db = new sqlite3.Database("MyDB.sqlite3");
  
      db.serialize(function() {
  
          var myJsonObj = {};
  
          db.each("select * from Table1",
              function(err, row) {
                  console.log("\n---- 0 ----\n");
                  // calculate doorId from row
                  doorId = ...
  
                  db.all("select * from Table2 where ID=" + doorId,
                         function(err, row2) {
                             console.log("---- 6 ----\n");
                             if(err) {
                                 console.log("-- ERR: " + err);
                             } else {
                                 console.log(row2);
                                 var myJsonElem = {ID:row.ID,
                                     DoorName: row2.DoorName,
                                     TimeSpec: row2.TimeSpec };
  
                                 myJsonObj.data.push(myJsonElem);
                             }
                         }
                 );
              }
          );
          callback(null, myJsonObj);
      });
  
      console.log("---- 10 ----\n");
      db.close();
  
  };
  </code></pre>