Fix: Ubuntu PostgreSQL install

Fix Ubuntu specific issues:
- Incorrect handle of service status and restart;
- Not enough memory to allocate default 1000 connections;
- Change maximal number of connections in UI doesn't change config file.

To check this PR:
- Install PostgreSQL on Ubuntu;
- Change maximal number connections in UI (eg., 500);
- Check max_connections value in config file /etc/postgresql/9.1/main/postgresql.conf. It should be the same as value in UI.