Updated configure.ac to check for pkg-config requirement

TODO: Fix check for libglib-2.0-0
Provided better C style for object copy

Added additional test to cover bad copy scenario.