Have master-side steps respect the timeout when removing files and directories

This addresses the issue described at <http://trac.buildbot.net/ticket/3055>.
The command result checking is quite hairy.

This needs to be looked at, but not in this PR.