Add missing LOCK(cs_main)

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Rebased-From: 305ccaa