ext.direction: fix off-by-one error in select()