A note on Mertens' formula for arithmetic progressions