Deal with errors when binding sockets