rdbms: normalize Database open() code and error handling