cocoa: added explicit typecast of TColor to ColorRef to prevent range check error

git-svn-id: http://svn.freepascal.org/svn/lazarus/trunk@46087 4005530d-fff6-0310-9dd1-cebe43e6787f
cocoa: retaining object before the removingFromSuperview, since the object is released again afterwards. unclear the purpose of autorelease pool that could be part of the problem

git-svn-id: http://svn.freepascal.org/svn/lazarus/trunk@46088 4005530d-fff6-0310-9dd1-cebe43e6787f