Bugfix: crash when slicing one layer objects with sailfish G-code flavor. Includes regression test. #2335