Sync some of the lower level DB code with perl5db.pl 5.17