handled respond_to? with private methods

Back port of commit 127411fdf3a3470e8830abf0c7876db67c0c344a

This is necessary to support ruby 2, which made Object#initialize_dup a
private method.