appliance/postgresql: Move wait function to pkg/postgres

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
controller: Wait for postgres to come up

This solves a race condition where bootstrap starts the controller
before postgres is fully available in service discovery.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
Merge pull request #659 from flynn/fix-postgres-race

Fix postgres race