util: also set pointer to NULL once freed
netif: move define on top
pty: restore STDIN on SIGINT/TERM