TS-2551 Add a configure check for shared_ptr, and fall back on tr1