Handle failures when reopening STDIN

This technique isn't fully baked yet. For now, simply catch the
exception if reopening doesn't work (which happens in Travis or Jenkins
runs).

We're catching all types of exception because the type of exception
thrown changes based on platform.

Change-Id: Ie135bc4d8ad01a797fbef729e79ec39ef4055ff3
Reviewed-on: http://gerrit.causes.com/37397
Tested-by: jenkins <jenkins@causes.com>
Reviewed-by: Shane da Silva <shane@causes.com>