write_sha1_from_fd() should make new objects read-only