Fixed example tests to use temporary work directory for slaves.

Review: https://reviews.apache.org/r/15741/