Check for SPARK_YARN_MODE through a system property too since it can
sometimes be set that way (undoes a change in previous commit)