master: Add SAVE_METADATA_AT_EXIT config option

This commit adds a config option to master which allows to change if metadata
is dumped on "stop" or "restart" action. This feature is needed for tests of
changing master server because sometimes master server was being killed after
performing the clients requests but before sending them a confirmation.

Change-Id: I77613c9912c3f346f161923df9a5485c71f1d5c6