Reopen the directory after making filesystem changes.

This was causing test failures on Ubuntu 12.04 (Precise):
   https://travis-ci.org/ckennelly/asymmetricfs/jobs/34878410

Additionally, this refactors the logic for reading the directory into a
helper function.