fix copy and paste error in cleanup code.

found by clang.
move init of dnode cache abouve all error conditions.

Solves access of uninitialised memory if extract_init() fails. Pointed
out by clang.