Handle IPsec Advanced Settings save before IPsec is enabled
Handle IPsec Advanced Settings save before IPsec is enabled

If the Advanced Settings are saved before any other IPsec is set up then $config['ipsec'] can be just the empty string. As a result you can get:
a) If you select some debug settings then those are not saved. The code to save those settings was only executed when $config['ipsec'] was already an array. Actually the code already did the necessary "if isset() then unset()" stuuf. So I just took the the "if is_array()" away from the code block.

b) Some potential unset() can go wrong with errors like:
Fatal error: Cannot unset string offsets in /usr/local/www/vpn_ipsec_settings.php on line 168
This is corrected by adding more "if (isset())" checks.

Fixes Redmine #4865
phil-davis/pfsense,ptorsten/pfsense,jxmx/pfsense,ch1c4um/pfsense,NOYB/pfsense,jxmx/pfsense,ch1c4um/pfsense,phil-davis/pfsense,ptorsten/pfsense,ch1c4um/pfsense,dennypage/pfsense,dennypage/pfsense,dennypage/pfsense,NewEraCracker/pfsense,NewEraCracker/pfsense,dennypage/pfsense,BlackstarGroup/pfsense,ch1c4um/pfsense,pfsense/pfsense,phil-davis/pfsense,NewEraCracker/pfsense,NewEraCracker/pfsense,brunostein/pfsense,pfsense/pfsense,pfsense/pfsense,pfsense/pfsense,jxmx/pfsense,BlackstarGroup/pfsense,ptorsten/pfsense,BlackstarGroup/pfsense,brunostein/pfsense,NOYB/pfsense,brunostein/pfsense,BlackstarGroup/pfsense,phil-davis/pfsense,NOYB/pfsense