Close file handles after writing.
Merge branch 'master' into user-save

* master:
Update my_user dir when a new user is saved.
Merge branch 'master' into user-save

* master:
  Fix server error when my_user contains garbage.
Small code cleanup.
Merge pull request #17 from vole/user-save

Close file handles. Update my_user file when a new user is created.