core: don't dereference NULL when no main thread source is present.
core: don't lock mutex while waiting for sources.

This effectively prevents source threads from doing anything (deadlock).
main: prepare for passing options to source and sink modules.

Decision: options will be decoded and mapped to ctor arguments in make_source() and make_sink(), not in ctors themselves.
source: rename channels_ to channels_claimed_ for clarity.
main: reimplement option handling, this time with 'name=value' scheme and passing options via a map.