Don't leak fd when malloc fails (coverity)

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libcaca/trunk@4869 92316355-f0b4-4df1-b90c-862c8a59935f
Fix 2 buffers leaking even if we exist just afterwards (coverity)

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libcaca/trunk@4870 92316355-f0b4-4df1-b90c-862c8a59935f
Test limits before accessing the array (coverity)

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libcaca/trunk@4871 92316355-f0b4-4df1-b90c-862c8a59935f
Fill in the correct array (coverity)

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libcaca/trunk@4872 92316355-f0b4-4df1-b90c-862c8a59935f