Fix bug seen with multiple unique indexes.

Previously, with inserts into tables with multiple unique indexes, it was
trivial to cause deadlocks and buffer ref leaks because there was a built-in
assumption that unlocking would occur either when we decided not to insert, or
after actually inserting. This did not account for the fact that there could be
disagreement among different unique indexes concerning the uniqueness of a
particular tuple.

Add a new mechanism for having the core system call into an amcanunique AM and
release write locks for some unique indexes as needed. Add some smoke testing
for that system in the form of a new isolation test.