Fix crash when releasing corrupt module

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>