Be more conservative about returning OK

This adds a few checks to ensure that parsing the Smokey cache file succeeded,
and fails UNKNOWN if it didn't.
Write the nagios cache file more quickly

If the file is empty when nagios_check_cache.sh reads it, this is a problem.
To reduce the likelihood of this happening, we first run cucumber, and then
write the file in a single "echo $RESULT > $FILE" call.