[WIP] Fixed #253 - Prevent patch step from being interrupted

Strictly speaking, it doesn't prevent new websocket connections. ...yet.