fixed a Memory leaks on PouchDB message by using setimmediate to queue up the queries to the DB instead of just a normal nextTick