database: do not chroot(".") unless actually necessary
If we use default root (/), then we do not have to chroot to run scripts. Use APK_NO_CHROOT flag for this scenario to avoid the chroot. This helps with using apk with bwrap and OSTree.
Closes #10736 (closed).