Check if SplineChar defines a fg layer before trying to iterate its refs

Fixes segfault due to invalid access of sc2->layers[] in FVApplySubstitution().
Merge pull request #307 from blipvert/fixes/3

Check if SplineChar defines a fg layer before trying to iterate its refs