SERVER-8183 Iterative implementation of validateBSON().