[stable5] Fix db autotest  

Ref https://github.com/owncloud/core/issues/4289

cc @DeepDiver1975