macosx_application: refactor filename escape

Use Objective-C's new literal syntax to make the code simpler.
macosx_application: refactor psn matching code

Objective-C is shorter / more readable than snprintf.