Just for clarification, adding:

Code:
signal(SIGPIPE,SIG_IGN);
to upnp_main in upnp.c with the other calls to the signal function solved the crashing for me. UPnP still annoyingly restarts in the circumstances I've mentioned here (like ntp time updates), but this stops it from crashing for me.