staging/mei: propagate error codes up in the write flow