lib/string: chomp do not try to chomp empty strings

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>