[PATCH 4.9 220/240] dm ioctl: fix out of bounds array access when no devices