Avoid a division by zero when no swap (or memory) is found

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>