sources/terminal: change default pulse width from 100 to 30 ms.
core, source: join() with thread only if it is joinable (started and not detached).
core, main: split joining of source threads into its own function.
core: join source threads when destroying to avoid crashes.

Also introduce function is_destroying() for threads to be able to exit when core
is about to destroy.
sources/frequency: use Core::is_destroying().