Writes a heartbeat to the registry.

def Heartbeat(self):
    """Writes a heartbeat to the registry."""
    service_key = _GetServiceKey()
    try:
      winreg.SetValueEx(service_key, "Nanny.heartbeat", 0, winreg.REG_DWORD,
                        int(time.time()))
    except OSError as e:
      logging.debug("Failed to heartbeat nanny at %s: %s", service_key, e)