Fix #579. Reject writes to nonexistent databases