Fix incorrect file attachment if filetype is rejected

If an attachment is submitted via the API and the filetype is rejected, the
file would be attached anyway. However, if the file was encoded base64, the
content would not be decoded.
Merge pull request #668 from greezybacon/issue/api-attachment

Fix incorrect file attachment if filetype is rejected
Reviewed-By: Peter Rotich <peter@osticket.com>