The correct answer is A. he put it away.
The sentence "Having finished the book, it was put away by him" is in the passive voice. The passive voice is used when the focus of the sentence is on the action, rather than the person or thing doing the action. In this case, the focus is on the action of putting the book away, rather than on the person who put it away.
The other options are all in the active voice. In the active voice, the focus is on the person or thing doing the action. In this case, the focus would be on the person who put the book away.
Option B, "it was being put away by him," is in the progressive passive voice. The progressive passive voice is used to emphasize the ongoing nature of the action. In this case, the sentence would emphasize that the person was in the process of putting the book away.
Option C, "it was putting away by him," is ungrammatical. The verb "put" cannot be used in the progressive tense in the passive voice.
Option D, "No improvement," is incorrect. The sentence is grammatically correct, but it is not clear who put the book away. The other options are all more clear about who put the book away.