Refactored the environment-based test filtering.

Review: https://reviews.apache.org/r/25569
Removed duplicate error messaging in Docker::create.