Allow system calls to restart if interrupted

System calls can be interrupted by the signal handler
that progressbar installs. We need them to restart.

Fixes TOOLS-334
Rename bar variable to pbar to satisfy pylint