osd: fix snap trimming (dumpling backport)