Memory and file descriptor leak in QFontCache

Make the cache also use the ref counts
Make everyone who decrements a ref count check for 0 and delete
Move all cache logic to the cache
Same idea as 36cb3f3 and b3dae68 in Qt 5 without the extra stuff

Task-number: QTBUG-38035
Change-Id: I27bea376f4ec0888463b4ec3ed1a6bef00d041f8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Tslib QWS: also apply missing release coordinate code to non-raw mode

Even if the normal mode is used the release events may have zero coordinates.

Change-Id: Ia9de05928ab5dfc225665e3b2c9a4d42f6ba984e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Tslib plugin: also apply missing release coordinate code to non-raw mode

Even if the normal mode is used the release events may have zero coordinates.

Change-Id: I2eac8cf50dfcf9e62d8cec2423419a6579266849
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(cherry picked from qtbase/9ba7cc07dbef542bc73f97f1d7458699d25fbb8d)