Add custom hex2bin implementation for 5.3

Fixes https://github.com/owncloud/core/issues/11004

@DeepDiver1975 Please check - unit tests are now passing locally for me.
is that proved to be the correct php 5.3 implementation? :wink: