Dodecamer assembly of a metazoan AAA+ chaperone couples substrate extraction to refolding