debian: Update the build tests

Update the build test to closer from other GNOME ones and fix some
issues/the current test failing.
- don't use a deprecated function
- handle cross build autopkgtest environment
- include a runtime test as well

Original patch by Sebastien Bacher available here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946676
7 jobs for debian-build-test in 16 minutes and 11 seconds (queued for 6 minutes and 36 seconds)
latest