Check if database backup using pg_dump is in progress
The only thing I can think of is to check pg_stat_activity.application_name and see if any session with pg_dump (or pg_restore) is currently active. 



application_name is a value supplied by the client connecting to the database. So in theory this is not something that can be trusted completely - but I am not aware that pg_dump allows you to overwrite this. And if you don't use that information for security purposes this should be OK.