GND show the line correctly if orientation is on
(cherry picked from commit e924c0d8128f81e61b5a25a962cc1ea41e858125)
CR show keystone line correctly if orientation is on
(cherry picked from commit 0a154d6c8d8f21f2a850bcee53abcacb27c4a230)
Fix return value of dt_conf_get_int64 to be int64_t

No harm done, this function isn't used anywhere yet.
(cherry picked from commit b92fa01aa52602bf5c9d5f01a6b794951bfd2b9d)
Use dt_conf_get_int64 to read cache_memory
(cherry picked from commit caf725d1b1bd667d856f72f43c3a18cfb55afcbc)
Extend the upper limit for the cache size to 4Gb.

This will let dt cache around 131000 compressed thumbnails.
(cherry picked from commit 2ae4bb747378c1206d031e442394486842b91b41)
Make magic constant (4gb) more readable
(cherry picked from commit 94f3e2d3b3237c0bd6571285efcb8f8e5e4771e7)