progress: use 'encoding.trim' to trim items in output line correctly
Before this patch, 'progress' extension trims items in output line by
directly slicing byte sequence, but it may split at intermediate
multi-byte sequence.
This patch uses 'encoding.trim' to trim items in output line
correctly, even if it contains multi-byte characters.