Refs #4919: Remove int casting to support non-int GUIDs

Introduces sanitise_guid() (instead of casting) and elgg_get_guid_sql() for quoting GUID in SQL.

This commit is a result of our work on optimizing Elgg DB storage for chosen entities. We had problems with easy introducing and using non-integer guids. As you can see, there's lots of places in the core there it's assumed, that guid must be integer value. In our usage, we wanted to use strings (number:number in particular), and casting to int caused bad things to happen.

This pull request is an attempt to give ability of tunning up elgg core even more by wrapping this int-specific logic into functions that can be easily altered.

Most of the changes were done with regular expressions, some of it had to be done manually. It's possible we still missed something, but I think this commit is a good start.

We introduce functions:
sanitise_guid - replacement of explicit cast to int
elgg_get_guid_sql - function deciding for example if we should wrap argument into colons or not, in this implementation it casts to string without adding anything.