sed: fix a buglet in s///NUM handling

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>