Revised handling of GIF animations

- New option `-a`: Play animations at startup
- Ctrl-Space toggles animation for all GIF files
- Infinite loop for all animations
Overhauled window drawing, yet again; fixes issue #155

- Buffer for window content is bigger than the window, minimizes artifacts
  when window is resized
- Back to using XSetWindowBackgroundPixmap() instead of XCopyArea(),
  no need to handle exposure events; X server can show gray background directly
  after resize event before sxiv redraws the window contents
Made argument of s_strdup const
Generalized thumbnail loading, allows easier reloading of thumbnails later on
Unified file index variable for image & thumbnail mode
Count number of marked files
Pass marked files to external key handler in thumbnail mode; fixes issue #135
Fixed wrong thumbnail-to-file mappings caused by file deletions
Full redraw when removing files during thumbnail reloading; fixes issue #164
Added command to remove all image marks, bound to Ctrl-m; fixes issue #163
Increased contrast in default color set
Simplified thumbnail selection and marks
Further simplified thumbnail marks
Beautified thumbnail marks and selection border
Unified rotate actions in key-handler; use lossless operation based on file type
Added actions for tag addition & removal to key-handler
Refactored rotation in key-handler
Bug #165: Deletion of unnecessary null pointer checks

The function "free" performs input parameter validation.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/free.html

It is therefore not needed to check a passed pointer before this function call.
A corresponding update suggestion was generated by the software "Coccinelle"
from the following semantic patch approach.
http://coccinelle.lip6.fr/

@Remove_unnecessary_pointer_checks1@
expression x;
@@
-if (x != \(0 \| NULL\))
    free(x);

@Remove_unnecessary_pointer_checks2@
expression x;
@@
-if (x != \(0 \| NULL\)) {
    free(x);
    x = \(0 \| NULL\);
-}

@Remove_unnecessary_pointer_checks3@
expression a, b;
@@
-if (a != \(0 \| NULL\) && b != \(0 \| NULL\))
+if (a)
    free(b);

@Remove_unnecessary_pointer_checks4@
expression a, b;
@@
-if (a != \(0 \| NULL\) && b != \(0 \| NULL\)) {
+if (a) {
    free(b);
    b = \(0 \| NULL\);
 }

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Corrected i_alternate, fixes issue #171
Fixed segfault in ci_toggle_animation, fixes issue #173