Fix ring validate with device prior to rebalance.

A builder file with some devices added but before rebalance() is called
should be invalid (in the sense that validate() raises
RingValidationError instead of TypeError).

Change-Id: I5538239db4b2fde83be2390014504e35ccd7c0d3
Better escaping for GET /v1/a?format=xml.

Commit 8f9b135 fixed a bug where an XML attribute could have arbitrary
characters jammed into it, resulting in a document with arbitrary
tags... and it did remove the ability to get an arbitrary XML document
out of the object server. However, it left a couple of ways to get a
malformed XML document, one example of which is an account named ".

This fixes up the remaining ways and ensures you always get a
well-formed XML document in the account-listing response. Also, it
adds a unit test for the escaping of the container name; this was
already working, just untested.

If you look in the discussion for bug 1183884, you'll see that the
review comments there are basically "seems good, but could use a unit
test". (The astute reader will note that I am one of the guilty
parties in that review.)

I found this bug while writing the missing unit test.

The moral of this story is left as an exercise for the reader.

Fixes bug 1183884 harder.

Change-Id: I84b24dd930ba1bb6c4f674f8d3996639dedbce15
Merge "Better escaping for GET /v1/a?format=xml."
Merge "Fix ring validate with device prior to rebalance."