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

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