md(4): always trim the last partial sector
PR: 281978
(cherry picked from commit 4bf34c597c44a2393ac5ec483e9cecac128d8202)