Replaced cerr/exit with EXIT when parsing master flags.

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