mon: factor map_pg_creates() out of send_pg_creates()

Factor out the portion of the function that remaps creating pgs to osds
from the part that sends those pending creates out.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: only map/send pg creations if osdmap is defined

This avoids calculating new pg creation mappings if the osdmap isn't
loaded yet, which currently happens when during Monitor::paxos_init()
on startup.  Assuming osdmap epoch is nonzero, it should always be
safe to do this (although possibly unnecessary).

More cleanup here is certainly possible, but this is one step toward fixing
the bad behavior for #4675.

Signed-off-by: Sage Weil <sage@inktank.com>
mon: remap creating pgs on startup

After Monitor::init_paxos() has loaded all of the PaxosService state,
we should then map creating pgs to osds.  This ensures we do so after the
osdmap has been loaded and the pgs actually map somewhere meaningful.

Fixes: #4675
Signed-off-by: Sage Weil <sage@inktank.com>
Merge branch 'wip-mon-pg' into next

Reviewed-by: Samuel Just <sam.just@inktank.com>