SERVER-9038 Added test coverage and fixed a bug for unordered batch writes