Fix compilation of unit-tests.
Fix on exit hang in the event loop.
Don't use |ConstString::substr()|.

It was buggy and was used in a single place.
Use my own signal-blocking |base::Thread|.