Make CKAN sqlalchemy 0.8.4 compatible

Add conditional so that CKAN does not break if upgraded to 0.8.