Code

apcups plugin: Make sure the socket is closed on errors.