Fix some signed/unsigned conversions that could lead to incorrect sign extension.

Fixes CID 1222029.
Lower the probability of buffer overflows when possible.

Convert to 64-bit integer before performing arithmetic operations on 64-bit builds.

Fixes CID 1222022 and 1222023.
Remember window position: Ensure the window can't be completely hidden after restoring it.

Restore the window at its latest position only it the window is at least partially visible on one enabled monitor.

Fixes #4408.
EVR renderers: Query the IBaseFilter interface of the EVR only once.

Calling QueryInterface insides those functions led to deadlocks in some cases.

Refs: #4213.
DX9 Allocator-Presenter: correctly signal the pending device reset.
Sync renderer: Reset the device on display change.

Refs: #4213.
Avoid extra repaint when resetting the video device.

Update the OSD before pausing and after unpausing.

Refs: #4213.
Fix a deadlock when starting MPC-HC in D3D fullscreen and auto-changing the monitor mode.

Refs: #4213.
D3D fullscreen: Obey "Apply default monitor mode on fullscreen exit" option.

Refs: #4213.
VMR-9 (renderless)/EVR renderers: Improve device reset.

- Fix the display mode flickering when auto-changing the monitor mode.
- Fix auto-changing the monitor mode when starting in D3D fullscreen with "play 0 time" option or the auto-change delay greater than 0s.
- Fix a possible deadlock when starting in D3D fullscreen and "play 0 time" was used.

Fixes #4213 and #4214.
Update translations from Transifex:

 - Basque
 - British English
 - Catalan
 - Chinese (simplified)
 - Croatian
 - French
 - Galician
 - Hungarian
 - Japanese
 - Polish
 - Slovak
 - Spanish
 - Turkish
Cosmetics: Use better IDs from the resource strings.
Minor cosmetic: Fix a typo.
CSubPicQueueNoThread: Respect invalidation time.
Do not clear surface cache when max texture size has not been changed.

We were removing valid surfaces from the cache for PGS/DVB subtitles.
Basically surface cache was broken.
SubPic queue: Clear queue only when it's needed.

Time can decrease even within the same video frame and
it make no sense to purge whole queue, if we still can reuse buffered
subpic.