Serialize paths length-prefixed instead of 0-ending

This is a breaking change.  Old databases need to be
deleted.