Access Violation while freeing dinamic library