d3d: Sync bitmaps before resizing display to prevent changes being lost
after the resize.

This also fixes a bug with missing TTF glyphs following al_resize_display
(reported by APrince): https://www.allegro.cc/forums/thread/611833

(cherry picked from commit 4bc183f15e5647dea40ef69942231d41ab8ed3e8)
Allow command-tab to work in fullscreen window mode on OS X.
Also makes native message boxes show up correctly.

(cherry picked from commit dba94a9111713fcfc6fb98db4cb4d131ce26f4b5)
Support stencil buffer on iOS.

(cherry picked from commit dfffe6c4e29164b0c23ef5e0bb179e3c547c8a09)
CMake function copy_data_dir_to_build didn't properly handle dependencies.

Before this if you altered some example data, rebuilding Allegro would not copy the updated files. Now it works correctly (although it still copies each file 3 times for some reason).

(cherry picked from commit 2aefeefcda57bbde127bfd031aae04d58411da46)