WIP - empty changes results array

Working on replication in node, I found changes returning an empty results array to opts.complete in test.attachments.js, test 'Attachments replicate'.

This PR provides a new test in tests.changes.js which detects the error. I haven't yet investigated the cause.