You could also try:
Local $iFileExists = FileExists($sFilePath)
Local $hFileLockTest = FileOpen($filename, $FO_READ)
if $iFileExists = 1 And $hFileLockTest = -1 Then
; this file is locked!
Else
FileClose($hFileLockTest)
FileDelete($filename)
; from FileDelete: 'Some file attributes can make the deletion impossible, if this is the case look at FileSetAttrib() to change the attributes of a file.'
EndIf