check: GStreamer-specific adaptations

Reintroduced adaptations:

 * Make sure that fail_if(1) actually fails
   from commit 9f99d056a263e71a5e6181224829def906cf0226

New adaptations due to updated libcheck:

 * Many new configure.ac checks to cater for new dependencies
 * Make new compile-time compat fallbacks conditional
 * Avoid using relative paths for header files
 * Make timer_create() usage depend on posix timers, not librt
 * Rely on default AX_PTHREAD behavior to allow HAVE_PTHREAD to be used when
   checking for types and functions (like clock_gettime())
 * Avoid double declaration of clock_gettime() when it is availabe outside
   of librt by making compat declaration of clock_gettime() condtional
 * ASSERT_{CRITICAL,WARNING}() calls new _ck_assert_failed() instead of
   _fail_unless()
 * Remove libcheck fallback infrastructure for malloc(), realloc(),
   gettimeofday() and snprintf()

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727826