Have all application services been shut down successfully before patch application was started ? The lock error indicates some process is holding a lock on this code and therefore the patch is erroring out. Bounce the database and try again.
Patch is not applied correctly. Restart Database and reapply the patch. Do invalids compilation after patch.