also check malloc() return more often
So the init phase does not depend on SDL anymore. Signed-off-by: Thomas Bernard <miniupnp@free.fr>