[backport] Normalize final attachment filename.