$attachment[0], RLIKE issue, and only autoembed pdf files

Check that $attachment[0] exists before returning it.
Avoid issue with regexp chars in filename by using  LIKE '%%%s'
Do not autoembed non-pdf files just because they are on a line by themselves. Check $route. If file is not an attachment in _posts, and if  $route=VPDFE_AUTOEMBED && file is not a pdf file, do not embed it.