quote and escape patch ID

to properly set attributes for patches with spaces in ID