Use escapejs filter on JavaScript strings

The escapejs filter will correctly escape single quotes from JavaScript
strings which may otherwise trigger syntax errors. In this case, the
issue was visible using the French translation.

Also removed a trailing paranthesis coming out of nowhere.

Change-Id: I25001815e17be5afa8eb28cc28c5423e3dcd973c
Closes-Bug: #1311047
Avoid attr error on database backup page

For some reason (and I genuinely do not have a clue why) some
database-backups don't appear to have an instance attribute. This causes
a problem when loading the table data, as the db_name helper-function
raises an AttributeError.

It appears that we're prepared for obj.instance.name to not exist, but
if obj.instance doesn't exist, then we raise the attribute error.

The solution is to return the obj.instance_id in both cases.

Change-Id: I77a30e4aeb97744aa14151eca0b4c011476fb08d
Closes-Bug: 1312235
Merge "Avoid attr error on database backup page"
Merge "Use escapejs filter on JavaScript strings"