Permit ndb database queries on read-only media
GH#1040
Test with:
```
btrfs subvol del /tmp/r /tmp/r1
btrfs subvol create /tmp/r && dnf install \
/data/mock2/centos-8-x86_64/result/{rpm,rpm-libs}-4.14.3-21.4.el8.x86_64.rpm \
-y --installroot /tmp/r && \
btrfs subvol snapshot -r /tmp/r /tmp/r1
systemd-nspawn -D /tmp/r rpm -qa
systemd-nspawn -D /tmp/r1 rpm -qa
```
Before the patch, it would fail on /tmp/r1 (RO) with:
```
rpmxdbOpen: Read-only file system
error: cannot open Name index using unknown db - Operation not permitted
(1)
```