Dump PostgreSQL primary key with custom function as a default.

Fixes #16111. See it for more information.

For example, if I use pgcrypto extension in PostgreSQL 9.4 beta 1, where uuid-ossp extension isn't available for moment of writing, and thus required to use a gen_random_uuid() method as a primary key default.

In this case schema dumper wasn't able to correctly reconstruct create_table statement and lost primary key constraint on schema load.

If I create migration in PostgreSQL 9.4 beta 1 as:

```ruby
enable_extension 'pgcrypto'
create_table "pg_uuids", id: :uuid, default: "gen_random_uuid()", force: true do |t|
  t.string "name"
  t.uuid   "other_uuid", default: "gen_random_uuid()"
end
```

Schema dumper currently dumps it as this:

```ruby
create_table "pg_uuids", id: false, force: true do |t|
  t.uuid   "id",         default: "gen_random_uuid()", null: false
  t.string "name"
  t.uuid   "other_uuid", default: "gen_random_uuid()"
end
```

Instead of this:

```ruby
create_table "pg_uuids", id: :uuid, default: "gen_random_uuid()", force: true do |t|
  t.string "name"
  t.uuid   "other_uuid", default: "gen_random_uuid()"
end
```

What about to also backport it to 4-1-stable?
In this case it will look monstrous, as function should be defined before table creation:
```ruby
def test_schema_dumper_for_uuid_primary_key_with_custom_default
  # Create custom PostgreSQL function for generating UUIDs
  # to test dumping tables which columns have defaults with custom functions
  connection.execute <<-SQL
    CREATE OR REPLACE FUNCTION my_uuid_generator() RETURNS uuid
    AS $$ SELECT * FROM uuid_generate_v4() $$
    LANGUAGE SQL VOLATILE;
  SQL

  # Create such a table with custom function as default value generator
  connection.create_table('pg_uuids_2', id: :uuid, default: 'my_uuid_generator()') do |t|
    t.string 'name'
    t.uuid 'other_uuid_2', default: 'my_uuid_generator()'
  end

  # Test it itself
  schema = StringIO.new
  ActiveRecord::SchemaDumper.dump(connection, schema)
  assert_match(/\bcreate_table "pg_uuids_2", id: :uuid, default: "my_uuid_generator\(\)"/, schema.string)
  assert_match(/t\.uuid   "other_uuid_2", default: "my_uuid_generator\(\)"/, schema.string)

ensure
  drop_table 'pg_uuids_2'
  connection.execute 'DROP FUNCTION IF EXISTS my_uuid_generator();'
end
```

So I personally would prefer to keep function and table creation/destroy in setup/teardown blocks.

Will now extract testing in separate method.