fixed regression on ODatabaseThreadLocalFactory usage

fixed regression: ODatabaseThreadLocalFactory was ignored when passing from ORecordAbstract.getDatabase()