Neither stream nor file should require 0777 use 0644 instead, closes #1962.
Add channel number management functions
PID lookup, streaming pad filter and sbuf alloc optimizations

There is high probability (because of the "nature" of TS streams) that
next PID will match previous one. This patch tries to do simple "caching"
of last PID to speedup PID lookups.

The streaming pad filter is handled faster way now.

Also, sbuf allocations routines are optimized (better sb_size prediction and
allocation routine is called only on demand - not all time).
Changed the PID lookup and other optimizations

Followed the Adam's advice to remove _fast functions.
Optimize mpegts_input_recv_packets()
Use inline functions for the PID lookup optimizations
Revert dynamic instances iptv_input and iptv_network
SYS_DVBS can have other modulation, ex: PSK_8 which will not work without this fix
Javascript: define default sort for some config grids
Merge remote-tracking branch 'origin/pr/337'
pvr: change the directory permissions to more sane value

This might need reviewing and making configurable, but this is definitely
a more sane starting point than the original.
Merge remote-tracking branch 'origin/pr/338'