Small fixes, added EINTR loops around an mkdir and around fsync.