Detecting running pg_dump conflicting with schema changes
Unless somebody has overridden the application_name parameter for pg_dump, you could do this:
SELECT count(*) FROM pg_stat_activity
WHERE application_name = 'pg_dump';

If that gives you 0, no pg_dump is running.