Set running flag before starting the input thread.