QuickLook: Handle thumbnail generation

Read at most 1 KiB or 50 lines of a file and render the attributed string in a bitmap context.

The theme is set to Mac Classic to ensure a white background for best look when the previews are used as icons in Finder.

The user’s default fixed width font in size 4 is used. With this font size only around 7 lines are shown, so we need to make it smaller, but we probably want to scale down the result to allow fractional line heights.

A lot of code is copy/pasted from the QuickLook preview generator.
QuickLook: Check for cancellation

Add a bit of redundant code but it's useless to continue doing stuff if the request is cancelled by the user anyway.
QuickLook: Abort preview when type can't be determined