libfreerdp-codec: ClearCodec fix error codes and wrapping around of cursors