cleanup: Refactor common code in samples. (#403)
cleanup: Refactor common code in samples. (#403)

Also improve logging to troubleshoot build failures.
googleapis/google-cloud-cpp-spanner,googleapis/google-cloud-cpp-spanner,googleapis/google-cloud-cpp-spanner,googleapis/google-cloud-cpp-spanner