SELECT 1 FROM pg_roles WHERE rolname="USR_NAME"
And in terms of command line (thanks to Erwin):
psql postgres -tXAc "SELECT 1 FROM pg_roles WHERE rolname="USR_NAME""
Yields 1 if found and nothing else.
That is:
psql postgres -tXAc "SELECT 1 FROM pg_roles WHERE rolname="USR_NAME"" | grep -q 1 || createuser ...