Handle exception thrown by subprocess.check_output.

The || true syntax does not work on Windows.

Also, normalize the paths to the underlying OS style.

Change-Id: Ie13d2646fe239fccb9ab7b558a6c8d56b779b206
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>