If an LDB is opened with LDB_FLG_RDONLY tdb will refuse to grant read locks. Additionally, if LDB is opened with LDB_FLG_RDONLY a subsequent LDB will share the same tdb, which will be opened with O_RDONLY, and so fail to accept writes.
Fixed in Samba 4.8 by 6c28abc249f83a1083a71b2d526098d42c4f5c14