add some fsyncs() here and there, so that your wallet file gets to disk
before you remove your USB