Add route to persist history.yml on demand

Workaround for issue #244 (`history.yml` file not being written when server not shut down cleanly) but probably useful in other scenarios too.

Adds `post /system/persist-history` route to persist the `history.yml` file to disk on demand. As with other routes, it requires a json body with valid auth_token.

Not 100% sure on the route path, so happy to change if anyone has a better suggestion.