utils/db_berkeley: release file description in error cases
core: test the limits of nested select level before accessing array value