The given sentence is in past tense, as the words "before I left" suggest.
Hence, the verb in the blank will also be in past tense, as it indicates an action that happened before another past action 'left'.
Option A: 'Had locked' is in past perfect tense. This tense means 'past of the past'. It indicates an action that happened shortly before another action took place. This is similar to the given sentence, which also indicates an action before another "before I left'.
Hence A is the correct option.
Option B: 'Have been locking' is in the present perfect continuous tense. It indicates an action that began sometime in the past and is still continuing in the present. This tense isn't relevant here, hence B is incorrect.
Option C: 'Always lock' is in simple present tense. It refers to an action that's a daily habit, or a custom. But the given sentence refers to a past action. Hence C is incorrect.
Option D: 'Am going to lock' is in future tense, whereas the sentence is in past. Hence D is incorrect.