shaper: add FriBidi error handling

FWIW, some simple handling of possible errors. I have only done basic testing, but seems to work fine when I have either check fail always.