Hi,
The issue you are facing is due to other processes accessing your memory card. It could be due to viruses also. Install unlocker and after that right-click on the memory card and kill all process using the unlocker. If the error persists, then repeat the unlocker kill process and then format.
Good luck!