Close account files before renaming, instead of deferring.

Fixes file locking issues on Windows.