Refactored SMWSQLStore3 long string handling

Faster implementation per MYSQL profiling, since octet_length is
an expensive operation.

Change-Id: I68b958f312d5fc95f41b542f5a09677cd76a0275
Merge "Refactored SMWSQLStore3 long string handling"