Added workaround for QProcess::waitForStarted() by checking for state

Directly using QProcess::waitForStarted() bombs with buffer overflow
(https://codereview.qt-project.org/#change,62897). Added a workaround to
check for the state before calling waitForStarted.

Signed-off-by: Sateesh Kavuri <sateesh.kavuri@gmail.com>