fix Windows redefinition warning in compat.h

- also remove compat.h include from net.h as it comes from netbase.h
  (which is needed as base for net.h anyway)