[PATCH v3 2/9] add die() to log an error message and exit with a single call