Removes nested locks and updates server request format

Note that both read_raw and the function calling it were asking for
the same lock, so read_raw could never run.