master: Fix rotating changelogs in shadow master

This commit fixes a bug in the shadow master's code: when changelogs
were rotated, the currently written file wasn't reopened. This might
have caused shadow master's changelogs to be missing.

The issue is fixed by reorganizing code of the master server and
metalogger in a way that functions from changelog.h are always used to
write changelog entries and to rotate changelogs. This makes the
alternative implementation of changelog(...), changelog_rotate(...),
changelog_reload(...) and changelog_init(...) to disappear
from masterconn.cc.

This commit also moves all the files common to master, metalogger and
metarestore to src/master directory. This is to avoid a situation where
each of them includes files from others. Now only files from src/master
are included by other binaries.

Change-Id: I406e78f8540f79176bc0196bfdb4accbae15dd51