Fixing #1812 (hopefully) - adding read and write locks to yaml.
It's obviously not really possible to test that this fixes it,
but I'm confident that the locks work, and now we're using them,
so it *should*.
Signed-off-by: Luke Kanies <luke@madstop.com>