Some code cleanup & add support for GIFLIB >= 5.1.0

Off-topic to the PR: So I've been trying to work on issue #1105 for a while now, but I've not made too much progress. I believe that it's not FontForge's fault, or at least if it is, it's in a really subtle manner. It clearly appears to be a threading issue, but apparently all of FontForge's calls to Xlib/X is single-threaded...

Anyhow, this PR just contains a fix to allow giflib >= 5.1.0 to work (well 5.1.0, until they decide to break the API again) and some removal of old threading code that does nothing (see the commit message for more details).