Cleanup SchemaDumper

This PR is mainly style changes and does not change any behavior.

* Convert string concatenations to substitutions, which also enables less parentheses
* Prefer `if any?` to `unless empty?`
* Fix warnings for undefined `pk` local variable
* Extract private method `primary_key_for`. In addition to fixing an unassigned variable warning, this method more clearly shows the expected return value of the primary key.