marshal top level nil correctly

This prevents yaml.Marshal(nil) from panicking.