Check puppet exit codes during image builds

To get useful info from puppet exit codes we must use puppet detailed
exit codes then check the values as nonzero codes can indicate success.
Values of 4 and 6 indicate failure to exit $RETURNCODE when those values
are returned.

Change-Id: Idf6ac0956a3749ff0a42e0b39765f98865971870
Merge "Check puppet exit codes during image builds"