Fixing joomla/joomla-platform#1279

This fixes the fatal error that would occur when passing in a double dotted string to `JRegistry::set($path, $value)` by filtering the nodes, removing empty ones, and they re-keying the array. 

This has already been applied to the Framework.