trapping exits for proper closing of sockets

making molderl_stream and molderl_recovery modules trap exits so that their terminate function gets called so that they close their sockets