Multiple writes in succession results in multiple calls to same resource

If a resource is updated more than once in a row, then the same queued write will be invoked multiple times, once for each write update.  For example:

```
MyResource.save({ "id": 1 }, { "extra": "some data" })
MyResource.save({ "id": 2 }, { "extra": "some other data" })
```

In this case, the HTTP POST call will repeat twice for id=1, because it was already in the queue when id=2 was called.  I think this is because flush() is being called on ResourceWriteQueue after each save(), and this causes every item in the queue to be processed, including items that are already being processed.

I'm trying to figure out how to solve this.  Maybe ResourceWriteQueue should pop the items off the queue during _processWrite().  Then, if there's an error, push the same write back onto the queue.  Thoughts?