Coverity fixes for add_socketread(), save_formats(), paused_topic and handle_socks().

A batch of four minor fixes for problems found by Coverity:

 - Off-by-one error in add_socketread() and set_socketwrite();
 - Unused argument to save_formats();
 - paused_topic buffer too small;
 - File descriptor leak in handle_socks().