Add metadata for state backups.

This is part of my effort to split up the work for backups into a few smaller patches.
That sounds good (definitely something I didn't know about).  However, that implies to me not using a dedicated error value, as defined above.