caddy-frontend: Fix configuration validation script
As caddy_configuration_state provides information with exit code use it directly in the if instead of running it with $(), which stops execution when configuration is not changed.
Improve checking for too old result - do not remove the file, instead check for too old result and then recalculate.