Fix possible NULL dereference in program_set_schedule

Found By Coverity.
Add missing error code check in program_config_save

Found By Coverity.