Porting feature from https://github.com/Elgg/Elgg/issues/3047 into 1.8
more tweaks for 1.8 implementation of _elgg_get_access_where_sql
Supplying guid_column where applicable in all uses of _elgg_get_access_where_sql