Remove db environment on close on chrooted operations
- As we open the db from outside the chroot, the environment ends up
containing paths that are not valid once we enter the chroot causing
dumb issues like RhBug:513699 and RhBug:507309.
- We'd be better off removing the environment always after access but
limiting to chroots for now as the rpmdb open/close path is full of races
when environment is not present. Chroots are somewhat special environemnts
anyway and typically not concurrently accessed so it's less of an issue
there.
- While this still has all sorts of issues, it at least leaves the rpmdb
in chroot in a functional state after initial install.