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:
7 jobs for debian-build-test in 16 minutes and 11 seconds (queued for 6 minutes and 36 seconds)