Improvement of the memory quality of optical pulse pairs in atomic systems via four-wave mixing