livehttp: remove leftover segments if delsegs is on

Also check if i_numsegs is setted as delsegs is tru by default
and we don't want to cause suprises to people creating VOD-stuff.
lua: fix NULL dereference and flawed logic
transcode: fix logic/code when reinitialize filter on channel/rate change

Only check samplerate and physical_channels for now
lua: separate generic and interface-specific net functions
lua: small macro factorization