Make wait_for_postgresql more widely available
This method was created as part of !1664 (merged), but would be more generally useful in other parts of the codebase.
Perhaps we can consider moving the gitlab-ctl-commands lib contents to a separate software definition.