Fix write extra data problem in semihost API