[Reviewer: Mike] Dns expiry valgrind

This adds tests to verify the behaviour of DNS cache expiry. I've verified that valgrind reports a memory leak and an invalid read when running without https://github.com/Metaswitch/cpp-common/pull/39, but that that commit fixes them.