If the file locking is the problem:
1) Is it possible for avast! to "unlock" the file before trying to delete, repair or move it
2) KILL the process locking the file (that IS possible) if the file is locked - and then delete, repair or move it - to be sure that the infection is dealt with. If it's infected the issues with killing a process is a minor issue (my opinion anyway).
3) Or at least; give the user a possibility at the "unable to access file" to KILL the application locking the file, and then try again (with some explanation about what to do).