compiler: Write .o files atomically. See #14533