savevm: Fix potential memory leak

The leak was reported by cppcheck. Fix it by moving the g_malloc0 after
the argument validity check.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
