Backport r24073, r24126 and r24128; fix issue 2751 (FS corruption).

Note: 1.0.x isn't compatible with recent versions of BDB; I ended up
      doing this backport with BDB 4.2.


git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/1.0.x-issue-2751@864511 13f79535-47bb-0310-9956-ffa450edef68
2 files changed